/*

There are 2 categories of variables:

- Variables that start with PQ are cleaned variables easily to link to the
questionaire. These variables are ready for analysis.

- Variables that start with PP are auxiliar variables and not to be used for
analysis.

*/

use "$Baseline_dtRaw/surveys/150910_CEIS_BD_EE_Final.dta", clear

*checking for duplicates:

gen id_sl = _n
sort S1_1 S1_2 S1_3 S1_3_C2 S1_3_C3 S1_3_C4 S1_4 S1_5 S1_5_C1 S1_6 S1_7 S1_8 S1_9 S1_9_C12 S1_10 S1_11 S1_12 S1_12_C12 S1_13 S1_14 S1_15 S1_16 S1_17 S1_18_0_Q S1_18_1_Q S1_18_2_Q S1_18_3_Q S1_18_4_Q S1_18_5_Q S1_18_6_Q S1_18_7_Q S1_18_8_Q S1_18_9_Q S1_18_10_Q S1_19 S1_19_C6 S1_20 S1_20_C4 S1_21 S1_22 S1_22_C6 S1_23 S2_1 S2_2 S2_3 S2_4 S2_5 S2_6 S2_6_Codes S2_7 S2_7_C8 S2_8 S2_8_Codes S2_9 S2_10 S2_10_Codes S2_11 S2_12 S2_131 S2_132 S2_133 S2_13_C9 S3_1 S3_1_ValorKz1 S3_2 S3_2_ValorKz2 S3_3 S3_4 S3_5 S3_6 S3_7 S3_8 S3_9 S3_10 S3_11 S3_12 S3_13 S3_141 S3_142 S3_14_C5
quietly by S1_1 S1_2 S1_3 S1_3_C2 S1_3_C3 S1_3_C4 S1_4 S1_5 S1_5_C1 S1_6 S1_7 S1_8 S1_9 S1_9_C12 S1_10 S1_11 S1_12 S1_12_C12 S1_13 S1_14 S1_15 S1_16 S1_17 S1_18_0_Q S1_18_1_Q S1_18_2_Q S1_18_3_Q S1_18_4_Q S1_18_5_Q S1_18_6_Q S1_18_7_Q S1_18_8_Q S1_18_9_Q S1_18_10_Q S1_19 S1_19_C6 S1_20 S1_20_C4 S1_21 S1_22 S1_22_C6 S1_23 S2_1 S2_2 S2_3 S2_4 S2_5 S2_6 S2_6_Codes S2_7 S2_7_C8 S2_8 S2_8_Codes S2_9 S2_10 S2_10_Codes S2_11 S2_12 S2_131 S2_132 S2_133 S2_13_C9 S3_1 S3_1_ValorKz1 S3_2 S3_2_ValorKz2 S3_3 S3_4 S3_5 S3_6 S3_7 S3_8 S3_9 S3_10 S3_11 S3_12 S3_13 S3_141 S3_142 S3_14_C5: gen dup = cond(_N==1,0,_n)
gen id_2 = _n
order id_sl dup id_2

*drop observations with no information
drop if id_2>=2383

drop id_sl id_2 dup

* three other observations are too incomplete:
drop if inlist(Respondent_ID,"068ebf10-defb-40fb-ac81-b759a97285dc","314976d3-2a00-40df-9781-5de0a173efe7","f0a76cb0-5c36-4bbe-b030-de680058f462")

********************************************************************************
************************************ INTRO *************************************
********************************************************************************

drop *_Codes

rename P14_Rec school_id
rename P13_Rec school_name
rename P12 bairro_name
rename ComunaDescricao commune_name
rename Respondent_ID resp_id
rename DataCollection_StartTime time_start
rename DataCollection_FinishTime time_finish
rename ID_Participante resp_idgame
rename P15 resp_tel
rename P2 resp_name
rename P3 student_name
rename P4 student_class
rename P5 resp_relation

gen vil_id = 1 if inlist(school_id,1,	2,	3,	4,	5,	6,	7,	8,	9,	10,	12,	13,	14,	15,	16,	17,	18,	19,	20,	21,	22,	24,	25,	26,	27,	28,	29,	30,	31,	32,	33,	34,	35,	37,	40,	45,	61,	86,	110)
replace vil_id = 2 if inlist(school_id,23,	43,	44,	46,	47,	48,	49,	50,	51,	52,	53,	54,	55,	56,	57,	58,	59,	60,	62,	63,	64,	65,	66,	67,	68,	69,	70,	71,	72,	73,	75,	76,	77,	78,	79,	80,	81)
replace vil_id = 3 if inlist(school_id,11,	36,	38,	39,	41,	42,	74,	82,	83,	84,	85,	87,	88,	89,	90,	91,	92,	93,	94,	95,	96,	97,	98,	99,	101,	102,	103,	104,	105)
replace vil_id = 4 if inlist(school_id,118,	119,	120,	121,	122,	123,	124,	125)
replace vil_id = 5 if inlist(school_id,100,	112,	113,	114,	115,	116,	117)
replace vil_id = 6 if inlist(school_id,109,	111)
replace vil_id = 7 if inlist(school_id,106,	107)
replace vil_id = 8 if inlist(school_id,126)
replace vil_id = 9 if inlist(school_id,108)

lab def vil 1 "Sumbe" 2 "Porto Amboim" 3	"Gabela" 4	"Conda" 5	"Ebo" 6	"Quilenda" 7	"Seles" 8	"Cassongue" 9	"Quibala"
lab val vil_id vil

lab var school_id 			"ID number school"
lab var school_name 		"Name school"
lab var vil_id 				"ID number village, value label includes names"
lab var commune_name 		"Name commune"
lab var bairro_name 		"Name neighbourhood"
lab var resp_id 			"ID number respondent"
lab var resp_idgame			"ID number respondent games (parent)"
lab var resp_name 			"Name respondent"
lab var resp_tel 			"Phone number main respondent"
lab var time_start 			"What time did the interview start?"
lab var time_finish 		"What time did the interview end?"
lab var student_name		"Name student"
lab var student_class		"Class grade the student is in"
lab var resp_relation		"Relation between respondent and student"
lab var P5_C5				"AUX"

recode student_class (1=3) (2=4) (3=5) (4=6)
#delimit;
lab def student_class
3	"3rd grade"
4	"4th grade"
5	"5th grade"
6	"6th grade"
;
lab def resp_relation
0	"Respondent"
1	"Parent"
2	"Uncle/aunt"
3	"Grandparent"
4	"Brother/sister"
5	"Cousin"
6	"Brother/sister-in-law"
7	"Stepfather/stepmother"
8	"Husband/wife"
9	"Father/mother-in-law"
10 	"No particular relation"
;
#delimit cr
lab val student_class student_class
lab val resp_relation resp_relation

replace resp_relation =0 if P5_C5=="A respondente"
replace resp_relation =0 if P5_C5=="O respondente"
replace resp_relation =0 if P5_C5=="Respondente"
replace resp_relation =0 if P5_C5=="Proprio"
replace resp_relation =1 if P5_C5=="MAE"
replace resp_relation =1 if P5_C5=="filhO"
replace resp_relation =1 if P5_C5=="Mãe"
replace resp_relation =2 if P5_C5=="tia"
replace resp_relation =3 if P5_C5=="Avô"
replace resp_relation =4 if P5_C5=="Irma"
replace resp_relation =5 if P5_C5=="Primo"
replace resp_relation =5 if P5_C5=="PRIMA"
replace resp_relation =6 if P5_C5=="Conhada"
replace resp_relation =6 if P5_C5=="CUNHADO"
replace resp_relation =6 if P5_C5=="CUNHADA"
replace resp_relation =7 if P5_C5=="enteada"
replace resp_relation =7 if P5_C5=="MADRASTA"
replace resp_relation =7 if P5_C5=="PADRASTO"
replace resp_relation =8 if P5_C5=="Esposo"
replace resp_relation =8 if P5_C5=="ESPOSA"
replace resp_relation =9 if P5_C5=="SOGRA"
replace resp_relation =10 if P5_C5=="esta só a crescer na minha casa"
replace resp_relation =10 if P5_C5=="Nenhum"

order resp_id time_start time_finish school_id school_name resp_name resp_idgame resp_tel vil_id commune_name bairro_name student_name student_class resp_relation

drop Apresentacao1 Provincia ProvinciaCodigo ProvinciaDescricao Municipio MunicipioCodigo MunicipioDescricao Comuna ComunaCodigo P13 P14 DataCollection_EndQuestion


********************************************************************************
********************************** SECTION 1 ***********************************
********************************************************************************
{
lab var S1_1 		"Age respondent"
lab var S1_2 		"Respondent is female"
lab var S1_3 		"Current home neighbourhood relative to the school"
lab var S1_3_C2		"Name current home neighbourhood if in other community/neighborhood of the commune where the school is located"
lab var S1_3_C3		"Name current home neighbourhood if in the centre of the municipality where the school is located"
lab var S1_3_C4		"Name current home neighbourhood if outside the municipality where the school is located"
lab var S1_4 		"Birthplace municipality"
lab var S1_5 		"Respondent grew up in current home neighbourhood"
lab var S1_5_C1		"Neighbourhood respondent grew up in if not in the current home neighbourhood"
lab var S1_6 		"Time of leaving birthplace"
lab var S1_7 		"Time of arriving current hometown"
lab var S1_8 		"Highest level of education enjoyed by respondent"
lab var S1_9		"NEEDS WORK!! Ocupation respondent"
lab var S1_10 		"Marital status"
lab var S1_11 		"Highest level of education enjoyed by partner"
lab var S1_12 		"NEEDS WORK!! Ocupation partner"
lab var S1_13 		"Monthly total home income"
lab var S1_14 		"How many of your children live in this (your) home?"
lab var S1_15 		"How many children live in this (your) home but are not your children?"
lab var S1_16 		"How many of the children who live in your house are girls?"
lab var S1_17 		"How many of the children living in this (your) home attend this elementary school?"
lab var S1_18_0_Q 	"(1) School year of child that lives with respondent"
lab var S1_18_1_Q 	"(2) School year of child that lives with respondent"
lab var S1_18_2_Q 	"(3) School year of child that lives with respondent"
lab var S1_18_3_Q 	"(4) School year of child that lives with respondent"
lab var S1_18_4_Q 	"(5) School year of child that lives with respondent"
lab var S1_18_5_Q 	"(6) School year of child that lives with respondent"
lab var S1_18_6_Q 	"(7) School year of child that lives with respondent"
lab var S1_18_7_Q 	"(8) School year of child that lives with respondent"
lab var S1_18_8_Q 	"(9) School year of child that lives with respondent"
lab var S1_18_9_Q 	"(10) School year of child that lives with respondent"
lab var S1_19 		"Language spoken at home"
lab var S1_20 		"Type of home in terms of ownership"
lab var S1_21 		"Aproximate distance in km between home and school"
lab var S1_22 		"Method of transportation used by children between home and school"
lab var S1_23 		"Time in minutes spend by children between home and school"

drop S1_18_10_Q

#delimit;
lab def dummy
1	"Yes"
0	"No"
;
lab def wrtschool
1 "This community/neighborhood where we are"
2 "Another community/neighborhood of the commune (1)"
3 "At the centre of the municipality (2)"
4 "Out of town (3)"
;
lab def maritalstatus
1 "Married"
2 "De facto union"
3 "Single"
4 "Widowed"
5 "Divorced/separated"
;
lab def edu1
1 "None"
2 "First grade"
3 "First level (former elementary school)"
4 "Second level (old high school, 5th and 6th grade)"
5 "Third level (former preparatory school, 7th and 8th grades)"
6 "High school (9th to 12th grade)"
7 "Professional technical education (2-4 years)"
8 "University - Angola"
9 "University - abroad"
10 "Post-graduation - Angola"
11 "Graduate - abroad"
;
lab def ocu
1 "Part-time salaried employment in the private sector"
2 "Part-time salaried employment in the public sector"
3 "Full-time salaried employment in the private sector"
4 "Full-time salaried employment in the public sector"
5 "Self-employment (does not employ other persons)"
6 "Owner of a business (employs other people)"
7 "Peasants (subsistence agriculture)"
8 "Farmer (employs others)"
9 "Retired"
10 "Student (still in school)"
11 "Domestic worker/housekeeper"
12 "Unemployed"
13 "Fisherman"
14 "Religious figure"
15 "Politician"
;
lab def income
1	"… <= 1 000 Cuanzas/mês."
2	"1 001 – 4 000 Cuanzas/mês."
3	"4 001 – 10 000 Cuanzas/mês."
4	"10 001 – 20 000 Cuanzas/mês."
5	"20 001 – 30 000 Cuanzas/mês."
6	"30 001 – 40 000 Cuanzas/mês."
7	"40 001 => … Cuanzas/mês."
;
lab def language
1	"Portuguese"
2	"Umbundu"
3	"Kimbundu"
4	"Kicongo"
5	"Ngoia"
;
lab def home
1 "Own home"
2 "Rented home"
3 "Accommodation made available by community or family"
4 "Accommodation made available by state"
5 "Accommodation made available by company"
;
lab def transport
1 "Walking"
2 "Bicycle"
3 "Candongueiro/taxi"
4 "Car"
5 "Motor bike"
6 "Hitchhiking"
;
#delimit cr

rename S1_1 Q1_01

rename S1_2 Q1_02
recode Q1_02 (1=0) (2=1)
lab val Q1_02 dummy

rename S1_3 Q1_03
lab val Q1_03 wrtschool
rename S1_3_C2 Q1_03_01
rename S1_3_C3 Q1_03_02
rename S1_3_C4 Q1_03_03

rename S1_4 Q1_04

rename S1_5 Q1_05
recode Q1_05 (1=0) (2=1)
lab val Q1_05 dummy

rename S1_5_C1 Q1_05_other

rename S1_6 Q1_06
rename S1_7 Q1_07
rename S1_8 Q1_08
lab val Q1_08 edu1

rename S1_9 Q1_09
recode Q1_09 (8=9) (9=10) (10=11) (11=12) (12=.)
lab val Q1_09 ocu
lab var S1_9_C12 "NEEDS WORK!! AUX"


rename S1_10 Q1_10
lab val Q1_10 maritalstatus

rename S1_11 Q1_11
lab val Q1_11 edu1

rename S1_12 Q1_12
recode Q1_12 (8=9) (9=10) (10=11) (11=12) (12=.)
lab val Q1_12 ocu
lab var S1_12_C12 "NEEDS WORK!! AUX"

rename S1_13 Q1_13
lab val Q1_13 income

rename S1_14 Q1_14
rename S1_15 Q1_15
rename S1_16 Q1_16
rename S1_17 Q1_17

rename S1_18_0_Q Q1_18_01
rename S1_18_1_Q Q1_18_02
rename S1_18_2_Q Q1_18_03
rename S1_18_3_Q Q1_18_04
rename S1_18_4_Q Q1_18_05
rename S1_18_5_Q Q1_18_06
rename S1_18_6_Q Q1_18_07
rename S1_18_7_Q Q1_18_08
rename S1_18_8_Q Q1_18_09
rename S1_18_9_Q Q1_18_10

rename S1_19 Q1_19
lab val Q1_19 language
drop S1_19_C6

rename S1_20 Q1_20
lab val Q1_20 home
replace Q1_20 = . if Q1_20==4
replace Q1_20 = 5 if S1_20_C4=="EMPRESA"
replace Q1_20 = 3 if S1_20_C4=="esto no quintal do vizinho a casa caio com as chuvas"
lab var S1_20_C4 "AUX"

rename S1_21 Q1_21

rename S1_22 Q1_22
lab val Q1_22 transport
drop S1_22_C6

rename S1_23 Q1_23

order S1_20_C4, after(Q1_23)
}
********************************************************************************
********************************** SECTION 2 ***********************************
********************************************************************************
{
lab var S2_1 		"Age student"
lab var S2_2 		"Student is female"
lab var S2_3 		"Student has siblings at this school"
lab var S2_4 		"Student has siblings at another elementary school?"
lab var S2_5 		"How do you think the students has been enjoying the school?"
lab var S2_6 		"In the last two weeks of classes, on how many days did the student not go to school?"
lab var S2_7 		"In the last two weeks of classes, what has been the main reason for the the student not going to school"
lab var S2_7_C8 	"AUX"
lab var S2_8 		"What is the name of the principal of the school where the student is studying?"
lab var S2_9 		"How do you think the performance of the principal has been?"
lab var S2_10 		"What is the name of the teacher of the student?"
lab var S2_11 		"How do you think the performance of the teacher has been?"
lab var S2_12 		"Did you receive any information about the performance at school of the student last year?"
lab var S2_131 		"(1) What is/are the reason(s) why you decided that the student should go to school?"
lab var S2_132 		"(2) What is/are the reason(s) why you decided that the student should go to school?"
lab var S2_133 		"(3) What is/are the reason(s) why you decided that the student should go to school?"
lab var S2_13_C9 	"AUX"

rename S2_(#) 	Q2_0(#)
rename S2_(##) 	Q2_(##)
rename S2_131 	Q2_13_01
rename S2_132 	Q2_13_02
rename S2_133 	Q2_13_03

replace Q2_01 = . if Q2_01==0
replace Q2_01 = . if Q2_01>=30

recode Q2_02 (1=0) (2=1)
lab val Q2_02 dummy

recode Q2_03 (2=0)
lab val Q2_03 dummy

recode Q2_04 (2=0)
lab val Q2_04 dummy

#delimit;
lab def good
1	"Very good"
2	"Good"
3	"Reasonable"
4	"Weak"
5	"Very weak"
;
lab def Q2_07
1	"He works in the field"
2	"He works in a family business"
3	"He does not want to go to school out of his own free will"
4	"Sickness"
5	"Someone in the family is sick"
6	"The teacher was missing"
;
#delimit cr

replace Q2_05 = . if Q2_05==6
lab val Q2_05 good

replace Q2_07=. if Q2_07==8
replace Q2_07=. if inlist(Q2_06,.,0)
lab val Q2_07 Q2_07

**** still need to categorize S2_7_C8 *****


replace Q2_09 = . if Q2_09==6
lab val Q2_09 good

replace Q2_11 = . if Q2_11==6
lab val Q2_11 good

recode Q2_12 (3=.) (2=0)
lab val Q2_12 dummy

#delimit;
lab def Q2_13
1	"To ensure a better life"
2	"To keep the student busy"
3	"The school is close to home"
4	"The costs of school supplies are low"
5	"Good teachers"
6	"Good facilities"
7	"Access to school meals"
8	"Learning to read and write"
9	"Other. Specify:"
;
#delimit cr

lab val Q2_13_01 Q2_13_02 Q2_13_03 Q2_13

**** still need to categorize S2_13_C9 *****
}
********************************************************************************
********************************** SECTION 3 ***********************************
********************************************************************************
{
#delimit;
lab def Q3_12
1	"Once a week"
2	"Once every 2 weeks"
3	"Once a month"
4	"Once a trimester"
5	"Once per semester"
6	"Once a year"
;
lab def satisfied
1	"Very satisfied"
2	"Satisfied"
3	"Unsatisfied"
4	"Very Unsatisfied"
;
lab def Q3_14
1	"Little time available to talk to the teacher"
2	"Topics depicted are of little or no relevance"
3	"Meeting times inappropriate"
4	"Lack of information on when and where meetings take place"
;
lab def Q3_18
1	"Representatives are elected by all parents present at the first parent meeting"
2	"The school board chooses the representatives"
3	"The teachers choose the representatives"
4	"They are the same representatives from last year"
5	"The community (leader) chooses the representatives"
;
lab def Q3_20
1	"I was not interested"
2	"I was working"
3	"I was not informed"
4	"I did not have time"
5	"I was sick"
6	"I was outside the village"
;
lab def Q3_22
1	"School"
2	"House of teacher"
3	"House of some parent or guardian"
4	"House of director"
5	"Community building"
;
lab def Q3_26
1	"Suggest changes to what is taught in school"
2	"Suggest changes to the applied teaching method"
3	"Discuss how money provided by the state to the school should be spent"
4	"Discuss student attendance"
5	"Talk to teachers or director about teacher attendance"
6	"Report school problems to direction"
7	"Report school problems to higher authorities"
8	"Collect materials or community money"
9	"Discuss student achievement"
10	"Other. Specify:"
;
lab def Q3_39
1	"Decide how the money made available to the school by the state is spent"
2	"Prepare school development plan"
3	"Talk to parents/guardians about student attendance"
4	"Talk to teachers about their attendance"
5	"Discuss the possibility of dismissing a teacher"
6	"Report school problems to higher levels"
7	"Gather money and/or community materials"
8	"Suggest changes to what is taught in school"
9	"Suggest changes to the way of teaching"
10	"Discuss issues presented by parents/guardians"
11	"Discuss issues presented by teachers"
12	"Talk about student achievement"
13	"Take care of the school building"
;
#delimit cr

lab var S3_1 			"Did you have to pay the school fees to enroll in the student?"
lab var S3_1_ValorKz1 	"Value in Kwanza"
lab var S3_2 			"Did you have to pay some bribe to the teacher/director for the student to secure a place in the school?"
lab var S3_2_ValorKz2 	"Value in Kwanza"
lab var S3_3 			"Did the student receive any books from the school at the beginning of the school year?"
lab var S3_4 			"What was the total expense you had in books for the student during the current school year?"
lab var S3_5 			"What was the total expense you had in teaching material for the student during the current school year?"
lab var S3_6 			"What was the total expense you had in school uniforms for the student during the current school year?"
lab var S3_7 			"What was the total expense you had in exam materials (for example: test books) for the student during the current school year?"
lab var S3_8 			"What was the total expense you had in private classes (explanations) for the student in the last year?"
lab var S3_9 			"What was the total of work days you offered for school construction/renovation projects during the past and present school years?"
lab var S3_10 			"What was your total contribution in cash for school construction/renovation projects during the past and present school years?"
lab var S3_11 			"What was the total value of the materials you offered for construction/renovation projects during the past and present school years?"
lab var S3_12 			"How often do you meet with the teacher of the student?"
lab var S3_13 			"How satisfied are you with these meetings?"
lab var S3_141			"(1) Why are you not satisfied with these meetings?"
lab var S3_142 			"(2) Why are you not satisfied with these meetings?"
lab var S3_14_C5 		"AUX"
lab var S3_15 			"How many times in the past year did you participate in these meetings with the teacher to talk about the performance of the student?"
lab var S3_16 			"Do you consider that the teacher would be available to meet with you outside of the scheduled meeting times with the parents if necessary?"
lab var S3_17 			"Is there a committee of parents and guardians in the school?"
lab var S3_18 			"How are representatives of the committee of parents and guardians appointed?"
lab var S3_18_C5 		"AUX"
lab var S3_19 			"Have you participated in the most recent election of representatives for the committee of parents and guardians?"
lab var S3_20 			"Why did you not participate?"
lab var S3_20_C5 		"AUX"
lab var S3_21 			"When was the last meeting of the committee of parents and guardians held?"
lab var S3_22 			"Where was the last meeting of the committee of parents and guardians held?"
lab var S3_22_C6 		"AUX"
lab var S3_23 			"Are you currently a representative of the committee of parents and guardians?"
lab var S3_24 			"In the past, have you ever been a representative of the committee of parents and guardians?"
lab var S3_25 			"What is the name of the coordinator of the committee of parents and guardians?"
lab var S3_261 			"(1) What are the main responsibilities of the committee of parents and guardians?"
lab var S3_262 			"(2) What are the main responsibilities of the committee of parents and guardians?"
lab var S3_263 			"(3) What are the main responsibilities of the committee of parents and guardians?"
lab var S3_264 			"(4) What are the main responsibilities of the committee of parents and guardians?"
lab var S3_265 			"(5) What are the main responsibilities of the committee of parents and guardians?"
lab var S3_26_C80 		"Other main responsibilities of the committee of parents"
lab var S3_27 			"How do you think the performance of the committee of parents and guardians last year was?"
lab var S3_281 			"AUX"
lab var S3_282 			"AUX"
lab var S3_283 			"AUX"
lab var S3_28_C1 		"(1) Why do you think the performance of the committee of parents and guardians was weak?"
lab var S3_28_C2 		"(2) Why do you think the performance of the committee of parents and guardians was weak?"
lab var S3_28_C3 		"(3) Why do you think the performance of the committee of parents and guardians was weak?"
lab var S3_29 			"Do you regularly see parents of other students outside of school?"
lab var S3_30 			"Do you discuss school-related issues outside the school with parents of other students?"
lab var S3_31 			"Is the teacher of the student your family or friend and do you see him/her outside of school?"
lab var S3_32 			"Do you discuss school-related issues outside the school with this teacher?"
lab var S3_33 			"Are you a member of any parent association other than the committee of parents and guardians of this school (eg at municipality level)?"
lab var S3_34 			"In which commune/municipality is it located?"
lab var S3_351 			"AUX"
lab var S3_352 			"AUX"
lab var S3_353 			"AUX"
lab var S3_35_C1		"(1) What are the main responsibilities of this other association of parents?"
lab var S3_35_C2 		"(2) What are the main responsibilities of this other association of parents?"
lab var S3_35_C3 		"(3) What are the main responsibilities of this other association of parents?"
lab var S3_36 			"Does this school have a school board?"
lab var S3_37 			"Are you a member of the school board?"
lab var S3_38 			"Have you ever been a member of the school board in the past?"
lab var S3_391 			"(1) What are the main responsibilities of the school board?"
lab var S3_392 			"(2) What are the main responsibilities of the school board?"
lab var S3_393 			"(3) What are the main responsibilities of the school board?"
lab var S3_394 			"(4) What are the main responsibilities of the school board?"
lab var S3_395 			"(5) What are the main responsibilities of the school board?"
lab var S3_39_C80 		"AUX"
lab var S3_40 			"How do you think the performance of the school board was, given the responsibilities outlined above?"
lab var S3_411 			"AUX"
lab var S3_412 			"AUX"
lab var S3_413 			"AUX"
lab var S3_41_C1 		"(1) Why do you think the performance of the school board was weak?"
lab var S3_41_C2 		"(2) Why do you think the performance of the school board was weak?"
lab var S3_41_C3 		"(3) Why do you think the performance of the school board was weak?"

rename S3_(#) Q3_0(#)
rename S3_(##) Q3_(##)
rename S3_28_C(#) Q3_28_0(#)
rename S3_35_C(#) Q3_35_0(#)
rename S3_41_C(#) Q3_41_0(#)
rename S3_141 Q3_14_01
rename S3_142 Q3_14_02
rename S3_26(#) Q3_26_0(#)
rename S3_39(#) Q3_39_0(#)
rename S3_1_ValorKz1 Q3_01_value
rename S3_2_ValorKz2 Q3_02_value

foreach var in Q3_01 Q3_02 Q3_03 Q3_16 Q3_17 Q3_19 Q3_23 Q3_24 Q3_29 Q3_30 Q3_31 Q3_32 Q3_33 Q3_36 Q3_37 Q3_38{
recode `var' (2=0) (3=.)
lab val `var' dummy
}

replace Q3_12 = . if Q3_12==7
lab val Q3_12 Q3_12

replace Q3_13 = . if Q3_13==5
lab val Q3_13 satisfied

replace Q3_14_01 = . if Q3_14_01==5
replace Q3_14_01 = . if S3_14_C5=="porque ela esta fraca"
replace Q3_14_01 = . if S3_14_C5=="Pouco desenpenho da parte dela"
replace Q3_14_01 = . if S3_14_C5=="Insucesso de Vasco"
replace Q3_14_01 = . if S3_14_C5=="OQUE O PROFESSOR DISSE NINGUÉM ESPERAVA"
replace Q3_14_01 = . if S3_14_C5=="Pedem dinheiro para sertos obigetivos e depos não vejo nada"

replace Q3_14_02 = . if Q3_14_02==5
replace Q3_14_02 = . if S3_14_C5=="pouco tempo de aula qui a professora dç porque veve no lobito."
replace Q3_14_02 = . if S3_14_C5=="esta faltar muito e não sebemos o porque."

lab val Q3_14_01 Q3_14_02 Q3_14

*other answers are all about why not satisfied with the professor rather than with the meetings

replace Q3_18 = . if Q3_18==5
replace Q3_18 = 5 if S3_18_C5=="SOBA"
replace Q3_18 = 5 if S3_18_C5=="a população"
replace Q3_18 = 5 if S3_18_C5=="o povo é qui escolhe."
replace Q3_18 = 5 if S3_18_C5=="o soba é que escolhe."
replace Q3_18 = 5 if S3_18_C5=="o soba."
replace Q3_18 = 5 if S3_18_C5=="pela população da aldeia."
lab val Q3_18 Q3_18

replace Q3_20 = . if Q3_20==5
replace Q3_20 = 2 if S3_20_C5=="estava na lavra"
replace Q3_20 = 4 if S3_20_C5=="ESTAVA EM OBITO"
replace Q3_20 = 4 if S3_20_C5=="estava na escola"
replace Q3_20 = 4 if S3_20_C5=="estava no curso."
replace Q3_20 = 4 if S3_20_C5=="estava numa campanha contra a pobreza"
replace Q3_20 = 4 if S3_20_C5=="esteve enternada com o bebe"
replace Q3_20 = 4 if S3_20_C5=="Etivi no obito"
replace Q3_20 = 4 if S3_20_C5=="motivo de obito"
replace Q3_20 = 5 if S3_20_C5=="doença"
replace Q3_20 = 5 if S3_20_C5=="doénça"
replace Q3_20 = 5 if S3_20_C5=="estava doente"
replace Q3_20 = 5 if S3_20_C5=="ESTAVA INTERNADA"
replace Q3_20 = 5 if S3_20_C5=="esteve hospitalisada"
replace Q3_20 = 5 if S3_20_C5=="etava enternada"
replace Q3_20 = 5 if S3_20_C5=="FIQUEI DOENTE"
replace Q3_20 = 6 if S3_20_C5=="estava foa da vila"
replace Q3_20 = 6 if S3_20_C5=="ESTAVA FORA"
replace Q3_20 = 6 if S3_20_C5=="estava fora da cidad3e"
replace Q3_20 = 6 if S3_20_C5=="esteve fora"
replace Q3_20 = 6 if S3_20_C5=="esteve fora da aldeia"
replace Q3_20 = 6 if S3_20_C5=="Esteve fora da cidade"
replace Q3_20 = 6 if S3_20_C5=="Estive fora da comunidade"
replace Q3_20 = 6 if S3_20_C5=="não 3stava cç."
replace Q3_20 = 6 if S3_20_C5=="nao estava present na comuna"

lab val Q3_20 Q3_20

replace Q3_22 = . if inlist(Q3_22,6,7)
lab val Q3_22 Q3_22
replace Q3_22 = 1 if inlist(S3_22_C6,"na escola antiga","tem sido feito na escola")
replace Q3_22 = . if S3_22_C6=="casa depassagem"

foreach var in Q3_26_01 Q3_26_02 Q3_26_03 Q3_26_04 Q3_26_05{
replace `var' = . if inlist(`var',11)
lab val `var' Q3_26
}
rename S3_26_C80 Q3_26_other

** categorise when objective is clearer

replace Q3_27 = . if inlist(Q3_27,6,7)
lab val Q3_27 good

replace Q3_34 = "Amboim (Gabela)" if Q3_34=="Amboim"
replace Q3_34 = "Amboim (Gabela)" if Q3_34=="Gabela"
replace Q3_34 = "Amboim (Gabela)" if Q3_34=="gabela"

replace Q3_34 = "Porto Amboim" if Q3_34=="P.Amboim"
replace Q3_34 = "Porto Amboim" if Q3_34=="PORTO AMBOIM"
replace Q3_34 = "Porto Amboim" if Q3_34=="Porto Amboim"
replace Q3_34 = "Porto Amboim" if Q3_34=="porto ambuim"

replace Q3_34 = "Sumbe" if Q3_34=="sume"
replace Q3_34 = "Sumbe" if Q3_34=="sumbe"
replace Q3_34 = "Sumbe" if Q3_34=="sube"
replace Q3_34 = "Sumbe" if Q3_34=="smbe"


foreach var in Q3_39_01 Q3_39_02 Q3_39_03 Q3_39_04 Q3_39_05{
replace `var' = . if inlist(`var',13,14)
lab val `var' Q3_39
}

replace Q3_39_01 = . if S3_39_C80=="é de dar aulas nos nossos filhos"
replace Q3_39_01 = . if S3_39_C80=="actividades extra-escolar"
replace Q3_39_01 = 6 if S3_39_C80=="de velar pelos problems da escola"
replace Q3_39_01 = 13 if S3_39_C80=="marcar reunião com os pais e cuidar a escola"
replace Q3_39_01 = 13 if S3_39_C80=="control das crianças, casas de banho, tanque de agua, contruçao de uma escola melhor"
replace Q3_39_01 = 13 if S3_39_C80=="fazer a limpeza, arumar as salas"

replace Q3_39_05 = . if S3_39_C80=="legalizar o aluno."
replace Q3_39_05 = 4 if S3_39_C80=="controlar os professores"
replace Q3_39_05 = 4 if S3_39_C80=="reunir com os professores"
replace Q3_39_05 = 13 if S3_39_C80=="discutir sobre o estado daescola"
replace Q3_39_05 = 13 if S3_39_C80=="não permitir que as crianças estraguem a escola"
replace Q3_39_05 = 13 if S3_39_C80=="cuidar bem da escola"
replace Q3_39_05 = 13 if S3_39_C80=="cuidar da estrutura"

replace Q3_40 = . if inlist(Q3_40,6,7)
lab val Q3_40 good

order S3_14_C5 S3_18_C5 S3_20_C5 S3_22_C6 S3_281 S3_282 S3_283 S3_351 S3_352 S3_353 S3_39_C80 S3_411 S3_412 S3_413, after(Q3_41_03)
}
********************************************************************************
********************************** SECTION 4 ***********************************
********************************************************************************
{
lab var S4_1A "First most important accomplishment achieved by this school last year (2013)"
lab var S4_1B "Second most important accomplishment achieved by this school last year (2013)"
lab var S4_1C "Third most important accomplishment achieved by this school last year (2013)"

rename S4_1A Q4_01
rename S4_1B Q4_02
rename S4_1C Q4_03

lab var S4_1A_C80 "AUX"
lab var S4_1B_C81 "AUX"
lab var S4_1C_C82 "AUX"

lab var S4_2_C1_Q1 "Classes with too many students"
lab var S4_2_C2_Q1 "Quality of classrooms"
lab var S4_2_C3_Q1 "Sanitary installations"
lab var S4_2_C4_Q1 "Poor health of students"
lab var S4_2_C5_Q1 "Failure to comply with schedules by students"
lab var S4_2_C6_Q1 "Absences from students"
lab var S4_2_C7_Q1 "Dropout rate"
lab var S4_2_C8_Q1 "Disordered conduct or physical conflict among students"
lab var S4_2_C9_Q1 "Appreciation of students towards teachers"
lab var S4_2_C10_Q1 "Disrespect of students towards teachers"
lab var S4_2_C11_Q1 "Lack of parent involvement in school"
lab var S4_2_C12_Q1 "Insufficient number of teachers"
lab var S4_2_C13_Q1 "Preparation of school staff"
lab var S4_2_C14_Q1 "Absenteeism of teachers"
lab var S4_2_C15_Q1 "Teachers' failure to meet schedules"
lab var S4_2_C16_Q1 "Teacher salaries are too low"
lab var S4_2_C17_Q1 "Teacher evaluation"
lab var S4_2_C18_Q1 "Motivation of teachers"
lab var S4_2_C19_Q1 "The school budget is not enough"
lab var S4_2_C20_Q1 "Teachers give private lessons to students of their own class"
lab var S4_2_C21_Q1 "Teachers give private lessons to students in other classes"
lab var S4_2_C22_Q1 "Lack of teaching material"
lab var S4_2_C23_Q1 "Cost of guaranteeing materials for students"
lab var S4_2_C24_Q1 "Automatic passage of children to the next class, even without use"
lab var S4_2_C25_Q1 "Specific agenda items"
lab var S4_2_C26_Q1 "Extracurricular activities"
lab var S4_30 "AUX"

rename S4_2_C1_Q1 Q4_04
rename S4_2_C2_Q1 Q4_05
rename S4_2_C3_Q1 Q4_06
rename S4_2_C4_Q1 Q4_07
rename S4_2_C5_Q1 Q4_08
rename S4_2_C6_Q1 Q4_09
rename S4_2_C7_Q1 Q4_10
rename S4_2_C8_Q1 Q4_11
rename S4_2_C9_Q1 Q4_12
rename S4_2_C10_Q1 Q4_13
rename S4_2_C11_Q1 Q4_14
rename S4_2_C12_Q1 Q4_15
rename S4_2_C13_Q1 Q4_16
rename S4_2_C14_Q1 Q4_17
rename S4_2_C15_Q1 Q4_18
rename S4_2_C16_Q1 Q4_19
rename S4_2_C17_Q1 Q4_20
rename S4_2_C18_Q1 Q4_21
rename S4_2_C19_Q1 Q4_22
rename S4_2_C20_Q1 Q4_23
rename S4_2_C21_Q1 Q4_24
rename S4_2_C22_Q1 Q4_25
rename S4_2_C23_Q1 Q4_26
rename S4_2_C24_Q1 Q4_27
rename S4_2_C25_Q1 Q4_28
rename S4_2_C26_Q1 Q4_29

#delimit
lab def Q4_part1
1	"Build / improve classrooms"
2	"Build / improve sanitary facilities"
3	"Build / improve other facilities (eg multipurpose field, library, cafeteria ...)"
4	"Encourage extracurricular activities (for example: football championships between schools)"
5	"Improve the results achieved in the final exams"
6	"Improve student performance at all levels"
7	"Reducing the dropout rate"
8 	"Reduce teacher absenteeism"
9 	"Improve student assiduity"
10	"Improving teacher assiduity"
11	"Improving the conditions offered to teachers (salaries, accommodation near the school and / or ease of transportation)"
12	"Improving materials/furniture/teaching methods"
13	"Improving administration"
14	"More teachers"
15	"More students/classes"
16	"Interpersonal relations"
17	"Parental involvement"
;
lab def Q4_part2
0	"Not a problem"
1	"Small problem"
2	"Average problem"
3	"Big problem"
;
lab val Q4_01 Q4_02 Q4_03 Q4_part1;
lab val Q4_04 Q4_05 Q4_06 Q4_07 Q4_08 Q4_09 Q4_10 Q4_11 Q4_12 Q4_13 Q4_14 Q4_15 Q4_16 Q4_17 Q4_18 Q4_19 Q4_20 Q4_21 Q4_22 Q4_23 Q4_24 Q4_25 Q4_26 Q4_27 Q4_28 Q4_29 Q4_part2;
#delimit cr

replace Q4_01 = . if inlist(Q4_01,12,13)
replace Q4_01 = 1 if S4_1A_C80=="A PINTURA DA ESCOLA"
replace Q4_01 = 1 if S4_1A_C80=="ainda esta em reablitacao"
replace Q4_01 = 1 if S4_1A_C80=="Ainda Não fez nada, mas ja estam a aumtarem nas salas de aulas"
replace Q4_01 = 1 if S4_1A_C80=="AUMENTARAM ALGUMAS TURMAS MAIS DE CHAPA"
replace Q4_01 = 1 if S4_1A_C80=="CONSTRUÇAO DE ALGUMAS SALAS ANEXAS"
replace Q4_01 = 1 if S4_1A_C80=="construçao de escola"
replace Q4_01 = 1 if S4_1A_C80=="construçao de salas de chapas"
replace Q4_01 = 1 if S4_1A_C80=="construiram uma sala de aula"
replace Q4_01 = 1 if S4_1A_C80=="CONTRUÇAO DUMA SALAS DE BLOCO"
replace Q4_01 = 1 if S4_1A_C80=="esta a ser feito a construicao de uma outra escola comeso no ano passado"
replace Q4_01 = 1 if S4_1A_C80=="esta escola foi renovada neste ano"
replace Q4_01 = 1 if S4_1A_C80=="esta se fazer a construicao de uma nova escola"
replace Q4_01 = 1 if S4_1A_C80=="esta se fazer aconstruicao de uma outra escola"
replace Q4_01 = 1 if S4_1A_C80=="esta se fazer uma nova escola"
replace Q4_01 = 1 if S4_1A_C80=="esta se fazer uma outra escola nova"
replace Q4_01 = 1 if S4_1A_C80=="esta ser feito a construicao de uma escola"
replace Q4_01 = 1 if S4_1A_C80=="esta ser feito outra escola"
replace Q4_01 = 1 if S4_1A_C80=="estam a fazer uma outra escola"
replace Q4_01 = 1 if S4_1A_C80=="na construicao de salas de chapa"
replace Q4_01 = 1 if S4_1A_C80=="na construicao de uma sala de aula"
replace Q4_01 = 1 if S4_1A_C80=="na construicaode uma sala de aulas"
replace Q4_01 = 1 if S4_1A_C80=="na pintura da parede da escola"
replace Q4_01 = 1 if S4_1A_C80=="Na reablitacao das salas de aulas"
replace Q4_01 = 1 if S4_1A_C80=="obras de melhoramento da escola"
replace Q4_01 = 1 if S4_1A_C80=="PINTURADA DA ESCOLA"
replace Q4_01 = 1 if S4_1A_C80=="REABILITAÇÃO DAS SALAS"
replace Q4_01 = 1 if S4_1A_C80=="renovaram a pintura"
replace Q4_01 = 3 if S4_1A_C80=="CANTINA ESCOLAR"
replace Q4_01 = 3 if S4_1A_C80=="construçao do muro de vedaçao"
replace Q4_01 = 3 if S4_1A_C80=="construiu-se um xafariz e um tanque"
replace Q4_01 = 3 if S4_1A_C80=="CONTRUCAO DE CHAFARIS"
replace Q4_01 = 3 if S4_1A_C80=="Contruicao do quintal"
replace Q4_01 = 3 if S4_1A_C80=="FEZ-SE UMA HORTA ESCOLAR"
replace Q4_01 = 3 if S4_1A_C80=="FOI FEITO UM JANGO"
replace Q4_01 = 3 if S4_1A_C80=="na contruicao de uma cantina"
replace Q4_01 = 3 if S4_1A_C80=="quital"
replace Q4_01 = 3 if S4_1A_C80=="REABILITARAM AS SALAS DE AGUA"
replace Q4_01 = 3 if S4_1A_C80=="uma cantina"
replace Q4_01 = 6 if S4_1A_C80=="educar os alunos"
replace Q4_01 = 12 if S4_1A_C80=="AUMENTO DOS MATERIAIS"
replace Q4_01 = 12 if S4_1A_C80=="AUMENTO DOS MTERIS"
replace Q4_01 = 12 if S4_1A_C80=="carteira"
replace Q4_01 = 12 if S4_1A_C80=="carteiras"
replace Q4_01 = 12 if S4_1A_C80=="CARTEIRAS QUADROS"
replace Q4_01 = 12 if S4_1A_C80=="COMPRA DE MAIS MATERIAIS DE ENSINO"
replace Q4_01 = 12 if S4_1A_C80=="COMPRA DE MATERIAS DE ENSINO"
replace Q4_01 = 12 if S4_1A_C80=="LIVROS"
replace Q4_01 = 12 if S4_1A_C80=="melhora mento das carteiras"
replace Q4_01 = 12 if S4_1A_C80=="MELHOROU AS PORTAS"
replace Q4_01 = 12 if S4_1A_C80=="MERENDA"
replace Q4_01 = 12 if S4_1A_C80=="Novas as carteira"
replace Q4_01 = 12 if S4_1A_C80=="Novas carteira"
replace Q4_01 = 12 if S4_1A_C80=="novas carteiras"
replace Q4_01 = 12 if S4_1A_C80=="ofereceu novas calteiras"
replace Q4_01 = 12 if S4_1A_C80=="oferta de carteiras a escola"
replace Q4_01 = 12 if S4_1A_C80=="quadro"
replace Q4_01 = 12 if S4_1A_C80=="Resebemos Carteiras Novas"
replace Q4_01 = 12 if S4_1A_C80=="So resebemos novos mubiliares"
replace Q4_01 = 12 if S4_1A_C80=="TEVE MEREBDA ESCOLAR"
replace Q4_01 = 14 if S4_1A_C80=="aumentou-se mais professores."
replace Q4_01 = 15 if S4_1A_C80=="duas turmas novas"
replace Q4_01 = 16 if S4_1A_C80=="A ESCOLA DEU UMA FESTA COM TODOS PAIS E ENCARR3GADO DE EDUCAÇÃO"
replace Q4_01 = 16 if S4_1A_C80=="FESTA DAS CRIANÇAS"
replace Q4_01 = 16 if S4_1A_C80=="FESTA FIM DE ANO"
replace Q4_01 = 16 if S4_1A_C80=="NATAL DAS CRIANÇAS"
replace Q4_01 = 16 if S4_1A_C80=="REALIZOU UMA FESTA COM OS ENCARREGADOS DE 3DUCAÇÃO"
replace Q4_01 = 17 if S4_1A_C80=="REUNIR COM OSENCARREGADO PARA FALAR SOBRE OS ALUNOS"

replace Q4_02 = . if inlist(Q4_02,12,13)
replace Q4_02 = 1 if S4_1B_C81=="conservar a escola"
replace Q4_02 = 1 if S4_1B_C81=="construçao de salas"
replace Q4_02 = 1 if S4_1B_C81=="construçao de salas anexas"
replace Q4_02 = 1 if S4_1B_C81=="MUDANÇA DE TETO DA ESCOLA"
replace Q4_02 = 1 if S4_1B_C81=="na contruicao das salas de chapas"
replace Q4_02 = 1 if S4_1B_C81=="na contruicao de mas duas salas de chapa"
replace Q4_02 = 1 if S4_1B_C81=="REPINTOU A ESCOLA"
replace Q4_02 = 3 if S4_1B_C81=="CANTINA"
replace Q4_02 = 3 if S4_1B_C81=="construiu tanque de agua"
replace Q4_02 = 3 if S4_1B_C81=="FIZERAM UM TANQUE DE AGUA"
replace Q4_02 = 3 if S4_1B_C81=="vedou-se a escola"
replace Q4_02 = 6 if S4_1B_C81=="aprender ler"
replace Q4_02 = 12 if S4_1B_C81=="carteira"
replace Q4_02 = 12 if S4_1B_C81=="CARTEIRAS NOVAS"
replace Q4_02 = 12 if S4_1B_C81=="LAPIS D COR"
replace Q4_02 = 12 if S4_1B_C81=="material para os aluno"
replace Q4_02 = 12 if S4_1B_C81=="Material para os alunos"
replace Q4_02 = 12 if S4_1B_C81=="Merenda escolar"
replace Q4_02 = 12 if S4_1B_C81=="novas carteiras"
replace Q4_02 = 12 if S4_1B_C81=="OFERTA DOS MANUAIS"
replace Q4_02 = 12 if S4_1B_C81=="quadros novos"
replace Q4_02 = 12 if S4_1B_C81=="recebeu se novas carteiras"
replace Q4_02 = 12 if S4_1B_C81=="Situaçlão de guardas"
replace Q4_02 = 12 if S4_1B_C81=="ensinar atividades ludicas"
replace Q4_02 = 15 if S4_1B_C81=="aulas no turno da noite"

replace Q4_03 = . if inlist(Q4_03,12,13)
replace Q4_03 = 1 if S4_1C_C82=="a facilitação no que toca vagas da sexta classe"
replace Q4_03 = 1 if S4_1C_C82=="CONSTRUÇAO DE UMA SALA DE CHAPA"
replace Q4_03 = 1 if S4_1C_C82=="esta se fazer a construicao de uma nova escola"
replace Q4_03 = 1 if S4_1C_C82=="na construicao das salas de chapa"
replace Q4_03 = 1 if S4_1C_C82=="na pintura da estrutura da escola"
replace Q4_03 = 2 if S4_1C_C82=="CONSTRUÇAO DE UMA CASA DE BANHO"
replace Q4_03 = 3 if S4_1C_C82=="CONSTRUÇAO DO TANQUE DE AGUA"
replace Q4_03 = 12 if S4_1C_C82=="AUMENTO DOS MATERIAS"
replace Q4_03 = 12 if S4_1C_C82=="CARTEIRAS"
replace Q4_03 = 12 if S4_1C_C82=="carteiras novas"
replace Q4_03 = 12 if S4_1C_C82=="MERENDA ESCOLAR"
replace Q4_03 = 12 if S4_1C_C82=="muchilas"
replace Q4_03 = 12 if S4_1C_C82=="Novas carteira"
replace Q4_03 = 12 if S4_1C_C82=="Resebemos carteiras novas"
replace Q4_03 = 14 if S4_1C_C82=="contratou novos professores"
replace Q4_03 = 14 if S4_1C_C82=="dar mais professores"

foreach var in Q4_04 Q4_05 Q4_06 Q4_07 Q4_08 Q4_09 Q4_10 Q4_11 Q4_12 Q4_13 Q4_14 Q4_15 Q4_16 Q4_17 Q4_18 Q4_19 Q4_20 Q4_21 Q4_22 Q4_23 Q4_24 Q4_25 Q4_26 Q4_27 Q4_28 Q4_29{
replace `var' = `var'-1
}

gen Q4_30 = .
replace Q4_30 = 1 if S4_30=="A eecola precisa de um cerco"
replace Q4_30 = 1 if S4_30=="a escola enche de agua portas estragadas."
replace Q4_30 = 1 if S4_30=="a escola esta sem qualidade"
replace Q4_30 = 1 if S4_30=="A ESTRUTURA GERAL FAESCOLA ESTA MUITO MAL"
replace Q4_30 = 1 if S4_30=="A falta de campo"
replace Q4_30 = 1 if S4_30=="casas de banho"
replace Q4_30 = 1 if S4_30=="mal condiçoes devia de acesso a escola"
replace Q4_30 = 1 if S4_30=="melhorar o teto a escola, e pôr energia"
replace Q4_30 = 1 if S4_30=="modificação da escola"
replace Q4_30 = 1 if S4_30=="mudar as janelas"
replace Q4_30 = 1 if S4_30=="mudar os tetos e as portas"
replace Q4_30 = 1 if S4_30=="O PROBLEMA MAIOR É DE POR UMANOVA ESTRUTURA DE ESCOLA AQUI NOBAIRRO"
replace Q4_30 = 1 if S4_30=="pintura"
replace Q4_30 = 1 if S4_30=="Pintura, carteiras .luz ,reparação da escola"
replace Q4_30 = 1 if S4_30=="PRECISA SER MELHORADA A ESTRUTURA ESCOLAR"
replace Q4_30 = 1 if S4_30=="rachaduras"
replace Q4_30 = 1 if S4_30=="Reconstrução da escola"
replace Q4_30 = 1 if S4_30=="reconstrução da escola .carteiras ,pintura"
replace Q4_30 = 1 if S4_30=="reconstruir a escola"
replace Q4_30 = 1 if S4_30=="Renovar as carteiras e aumentar turmas"
replace Q4_30 = 1 if S4_30=="Reparação da escola"
replace Q4_30 = 1 if S4_30=="Reparação das turmas"
replace Q4_30 = 1 if S4_30=="Uma nova escola"
replace Q4_30 = 1 if S4_30=="Uma nova escoladefinitiva"
replace Q4_30 = 1 if S4_30=="esola nova"
replace Q4_30 = 1 if S4_30=="FALTA DE ESCOLAS"
replace Q4_30 = 1 if S4_30=="nova escola"
replace Q4_30 = 2 if S4_30=="A FALTA DE MAIS SALAS"
replace Q4_30 = 2 if S4_30=="A falta de salas"
replace Q4_30 = 2 if S4_30=="A falta de salas de aulas e mais professor"
replace Q4_30 = 2 if S4_30=="A FALTA DE SALAS DE AULAS PARA O ENSINO PRIMçRIO"
replace Q4_30 = 2 if S4_30=="Aumento das salas de aulas"
replace Q4_30 = 2 if S4_30=="Aumento das salas e professores"
replace Q4_30 = 2 if S4_30=="Aumento de salas"
replace Q4_30 = 2 if S4_30=="Carencias de salas de aulas"
replace Q4_30 = 2 if S4_30=="falta de mais salas para os alunos deichar de estudar nas capelas"
replace Q4_30 = 2 if S4_30=="falta de mas classe"
replace Q4_30 = 2 if S4_30=="Falta de salas"
replace Q4_30 = 2 if S4_30=="falta de salas carteiras professor."
replace Q4_30 = 2 if S4_30=="FALTA SE MAS SALAS"
replace Q4_30 = 2 if S4_30=="faltas de salas aulas"
replace Q4_30 = 2 if S4_30=="faltas de salas de aulas"
replace Q4_30 = 2 if S4_30=="nova construção  aumento das  salas"
replace Q4_30 = 2 if S4_30=="numero e salas reduzidas"
replace Q4_30 = 2 if S4_30=="salas d2 aulas"
replace Q4_30 = 2 if S4_30=="salas de aulad"
replace Q4_30 = 2 if S4_30=="salas de aulas"
replace Q4_30 = 2 if S4_30=="salas de aulas e agua"
replace Q4_30 = 2 if S4_30=="salas novas, carteirasce cadeiras novas"
replace Q4_30 = 2 if S4_30=="sals de aulas"
replace Q4_30 = 2 if S4_30=="temos poucas salas e seria necessario aumento de salas porque os aluno estao fora de ensino."
replace Q4_30 = 3 if S4_30=="a falta de professores."
replace Q4_30 = 3 if S4_30=="contratar professores para o ensino de adulto~(anoit)"
replace Q4_30 = 3 if S4_30=="falta de professor"
replace Q4_30 = 3 if S4_30=="falta de professores."
replace Q4_30 = 3 if S4_30=="falta de turmas"
replace Q4_30 = 3 if S4_30=="falta professor"
replace Q4_30 = 3 if S4_30=="faltass dos professores"
replace Q4_30 = 3 if S4_30=="os professor faltam muito."
replace Q4_30 = 4 if S4_30=="meio de transpote"
replace Q4_30 = 5 if S4_30=="Guarda um não chega"
replace Q4_30 = 5 if S4_30=="segurança na escola e uma construçao definitiva."
replace Q4_30 = 6 if S4_30=="MERENDA ESCOLAR"
replace Q4_30 = 7 if S4_30=="çGUA"
replace Q4_30 = 7 if S4_30=="çgua  ,posto medico"
replace Q4_30 = 7 if S4_30=="çgua ,energia"
replace Q4_30 = 7 if S4_30=="çgua ,guardas  continas"
replace Q4_30 = 7 if S4_30=="çgua,falta de casas de banho"
replace Q4_30 = 7 if S4_30=="falta de agua"
replace Q4_30 = 8 if S4_30=="ENERGIA"
replace Q4_30 = 8 if S4_30=="energia, salas de aulas"
replace Q4_30 = 8 if S4_30=="falt de energia"
replace Q4_30 = 8 if S4_30=="falta de energia na escola"
replace Q4_30 = 8 if S4_30=="FALTA DE LUZ"
replace Q4_30 = 8 if S4_30=="FATA DE LUZ"
replace Q4_30 = 8 if S4_30=="L uz euma nova escola"
replace Q4_30 = 8 if S4_30=="Luz ,çgua"
replace Q4_30 = 8 if S4_30=="Luz ; çgua"
replace Q4_30 = 8 if S4_30=="Luz e Contina"
replace Q4_30 = 8 if S4_30=="nao temos luz na escola nem agua no bairro"
replace Q4_30 = 8 if S4_30=="organização da escola. tem que ter luz para o ensino de adulto."
replace Q4_30 = 10 if S4_30=="A falta de carteiras"
replace Q4_30 = 10 if S4_30=="a falta de carteiras e salas boas"
replace Q4_30 = 10 if S4_30=="Carteira"
replace Q4_30 = 10 if S4_30=="Carteiras"
replace Q4_30 = 10 if S4_30=="carteiras  quadro"
replace Q4_30 = 10 if S4_30=="Carteiras , quardro euma nova escola"
replace Q4_30 = 10 if S4_30=="Carteiras uma nova  escola e quadro"
replace Q4_30 = 10 if S4_30=="Carteiras, uma esola  nova"
replace Q4_30 = 10 if S4_30=="Falta de carteira e guarda"
replace Q4_30 = 10 if S4_30=="FALTA DE CARTEIRAS"
replace Q4_30 = 10 if S4_30=="Falta de carteiras e salas de aulas iproprias"
replace Q4_30 = 10 if S4_30=="Falta de carteiras em algumas salas"
replace Q4_30 = 10 if S4_30=="Falta de quadro ,carteiras e novas escola"
replace Q4_30 = 10 if S4_30=="faltas de professores e de carteiras"
replace Q4_30 = 10 if S4_30=="o chão , carteiras"
replace Q4_30 = 11 if S4_30=="a falta de trabalhadores de limpesas nas escola"
replace Q4_30 = 11 if S4_30=="HIGIENE NA ESCOLA"
replace Q4_30 = 12 if S4_30=="Falta de campo"
replace Q4_30 = 12 if S4_30=="Falta de capo desportivo"
replace Q4_30 = 12 if S4_30=="falta quintal"
replace Q4_30 = 12 if S4_30=="Falta quintal erepara escola toda"
replace Q4_30 = 12 if S4_30=="materias desportivos"
replace Q4_30 = 12 if S4_30=="patio da escola"
replace Q4_30 = 12 if S4_30=="pavimentacao do patio"
replace Q4_30 = 12 if S4_30=="Pintura e quintal"
replace Q4_30 = 12 if S4_30=="A falta de um campo multi-uso"
replace Q4_30 = 12 if S4_30=="A PRATICA DE EXERCÍCIOS FÍSICO"
replace Q4_30 = 12 if S4_30=="Campo"
replace Q4_30 = 13 if S4_30=="é que os professores não ensinam nada."
replace Q4_30 = 13 if S4_30=="O metodo de lecionar de sertos professores"
replace Q4_30 = 13 if S4_30=="os professores se comportam mç com os aluno."
replace Q4_30 = 13 if S4_30=="requalificaçao de professores"
replace Q4_30 = 14 if S4_30=="Hospital e aumento  de turmas"
replace Q4_30 = 14 if S4_30=="Posto de sçude uma nova escola"
replace Q4_30 = 14 if S4_30=="posto medico em falta"
replace Q4_30 = 14 if S4_30=="saude"
replace Q4_30 = 14 if S4_30=="um posto medico uma nova escola"

order Q4_30 S4_1A_C80 S4_1B_C81 S4_1C_C82, after(Q4_29)
lab var Q4_30 "Other problems that the respondent considers to be serious in school"

#delimit
lab def Q4_30
1	"Quality of other parts of the school building and/or in general"
2	"Not enough classrooms"
3	"Not enough teachers"
4	"Transportation to and from the school"
5	"No or not enough security"
6	"No or not enough school lunches"
7	"No or not enough water"
8	"No or not enough electricity/light"
9	"No or not enough involvement parents"
10	"No or not enough school materials (chairs, tables etc.)"
11	"No or not enough cleaning"
12	"No field"
13	"Teacher quality"
14	"Health related issues"
;
lab val Q4_30 Q4_30;
#delimit cr

replace Q4_04 = 3 if inlist(Q4_04,0,.) & S4_30=="Tem turmas que os alunos da 5classe estão com os da 4classe na mesma hora"
replace Q4_05 = 3 if inlist(Q4_05,0,.) & S4_30=="problemas de salas de aulas"
replace Q4_05 = 3 if inlist(Q4_05,0,.) & S4_30=="qualidades salas de, agua,"
replace Q4_06 = 3 if inlist(Q4_06,0,.) & S4_30=="Intalações sanitçrias são mçs."
replace Q4_17 = 3 if inlist(Q4_17,0,.) & S4_30=="AUSENCIA DOS PROFESSORES"
replace Q4_17 = 3 if inlist(Q4_17,0,.) & S4_30=="os professores só vêm dar aula um dia"
replace Q4_19 = 3 if inlist(Q4_19,0,.) & S4_30=="o professores ganho muito pouco"
replace Q4_21 = 3 if inlist(Q4_21,0,.) & S4_30=="o comportamento dos professores"
replace Q4_28 = 3 if inlist(Q4_28,0,.) & S4_30=="deve-se periorizar dentro do programa maior tempo possivél as disciplinas de língua portuguesa e matemçtica."
replace Q4_28 = 3 if inlist(Q4_28,0,.) & S4_30=="as crianças devem reprova quando não sabem."

*no changes are made which is fine

replace Q4_15 = 1 if Q4_30==3 & Q4_15==0
replace Q4_30 = . if Q4_30==3
}
********************************************************************************
********************************** SECTION 5 ***********************************
********************************************************************************
{
lab var S5_1A "(1) Imagine that this school receives 1 million Cuanzas from the Ministry of Education. How do you think this money should be spent? Please say up to three possible uses, starting with the most important"
lab var S5_1B "(2) Imagine that this school receives 1 million Cuanzas from the Ministry of Education. How do you think this money should be spent? Please say up to three possible uses, starting with the most important"
lab var S5_1C "(3) Imagine that this school receives 1 million Cuanzas from the Ministry of Education. How do you think this money should be spent? Please say up to three possible uses, starting with the most important"

rename S5_1A Q5_01
rename S5_1B Q5_02
rename S5_1C Q5_03

#delimit;
lab def Q5
1 "Purchase of school books."
2 "Construction/improvement of sanitary facilities."
3 "Increase in the number of classes for students (for example: during the afternoon)."
4 "School meals/snacks."
5 "Purchase/maintenance of furniture (eg desks, benches)."
6 "Extracurricular activities (eg football tournaments)."
7 "School projects (for example: multipurpose field)."
8 "Classroom building / improvement."
9 "Building/improving the library."
10 "Hiring more teachers."
11 "Increase teachers' salary by work day, to encourage attendance."
12 "Teacher training."
13 "School building/improvement in general"
14 "Lock the school yard"
15 "Construction/improvement of teachers' home/room"
16 "Light/electricity (generator)"
17 "Transportation for teachers/students"
18 "Contract security"
19 "Contract someone to clean"
20 "Water"
21 "Increase in the number of class grades at school"
;
lab val Q5_01 Q5_02 Q5_03 Q5;
#delimit cr

replace Q5_01 = . if inlist(Q5_01,13)
replace Q5_02 = . if inlist(Q5_02,13)
replace Q5_03 = . if inlist(Q5_03,13)

replace Q5_01 = 2 if S5_1A_C90=="canalizar agua para as casas de banho"
replace Q5_01 = 2 if S5_1A_C90=="casa de banho"
replace Q5_01 = 21 if S5_1A_C90=="construir uma escola das classes grande porque os meus filhos ja acabaram de estudar essas classes que estam ai e les falta as mais grande que nos não temos"
replace Q5_01 = 21 if S5_1A_C90=="na construicao de escola com as classe elevada"
replace Q5_01 = 21 if S5_1A_C90=="na construicao de mas escola com classes avansadas"
replace Q5_01 = 21 if S5_1A_C90=="Na construicao de uma escola de construicao definitiva com classes elevadas"
replace Q5_01 = 21 if S5_1A_C90=="Na construicao de uma escola nova com classes mas avansadas"
replace Q5_01 = 21 if S5_1A_C90=="Na consturicao de escola nova de construicao definitivo com classes elevada"
replace Q5_01 = 21 if S5_1A_C90=="no aumento de mas salas de aulas com classe elevada"
replace Q5_01 = 21 if S5_1A_C90=="no aumento de mas salas de aulas com classes mas elevadas"
replace Q5_01 = 21 if S5_1A_C90=="no aumento de mas turmas"
replace Q5_01 = 21 if S5_1A_C90=="Que tenha mais uma escola da 7ªclasse em diande"
replace Q5_01 = 21 if S5_1A_C90=="reablitação da escola e por mais turmas"
replace Q5_01 = 4 if S5_1A_C90=="cantina"
replace Q5_01 = 5 if S5_1A_C90=="CARTEIRAS"
replace Q5_01 = 5 if S5_1A_C90=="comprar carteiras,quadro"
replace Q5_01 = 5 if S5_1A_C90=="comprar material e reparar o qui sta mal na escola"
replace Q5_01 = 5 if S5_1A_C90=="MAQUINA TILOGRAFA"
replace Q5_01 = 8 if S5_1A_C90=="Aumentos de mas salas de aulas"
replace Q5_01 = 8 if S5_1A_C90=="construçao de sla de aula"
replace Q5_01 = 8 if S5_1A_C90=="construicoes de mas salas de aulas"
replace Q5_01 = 8 if S5_1A_C90=="Na Construicao de uma salas de aulas"
replace Q5_01 = 8 if S5_1A_C90=="na contruicao de mas salas de aulas"
replace Q5_01 = 8 if S5_1A_C90=="Nas construicoes de mas salas"
replace Q5_01 = 8 if S5_1A_C90=="nas contruicao de mas salas de aula"
replace Q5_01 = 8 if S5_1A_C90=="no aumento de mas salas de aulas"
replace Q5_01 = 8 if S5_1A_C90=="No aumento de mas salas de aulas ou mas escolas"
replace Q5_01 = 13 if S5_1A_C90=="ASFALTAR A VIA QUE DA ACESSO ç ESCOLA"
replace Q5_01 = 13 if S5_1A_C90=="condicionarer bem escola"
replace Q5_01 = 13 if S5_1A_C90=="construçao de uma escola nova"
replace Q5_01 = 13 if S5_1A_C90=="CONSTRUÇÃO DEFINITIVA COM TODAS CONDIÇÕES"
replace Q5_01 = 13 if S5_1A_C90=="construçao em sim da escola"
replace Q5_01 = 13 if S5_1A_C90=="construicao de uma escola"
replace Q5_01 = 13 if S5_1A_C90=="construicao de uma escola de carater definitivo"
replace Q5_01 = 13 if S5_1A_C90=="contruicao de uma escola de contruicao definitiva"
replace Q5_01 = 13 if S5_1A_C90=="JANELAS"
replace Q5_01 = 13 if S5_1A_C90=="MUDAR A ESCOLA NA TOTALIDADE"
replace Q5_01 = 13 if S5_1A_C90=="Na conetruicao de uma nova escola"
replace Q5_01 = 13 if S5_1A_C90=="na construicao de mas salas de aulas"
replace Q5_01 = 13 if S5_1A_C90=="Na construicao de uma escola de carater definitiva"
replace Q5_01 = 13 if S5_1A_C90=="Na construicao de uma escola de carater definitivo"
replace Q5_01 = 13 if S5_1A_C90=="Na construicao de uma escola de constricao definitivs"
replace Q5_01 = 13 if S5_1A_C90=="Na construicao de uma escola de construicao definitiva"
replace Q5_01 = 13 if S5_1A_C90=="na construicao de uma escola de raiz"
replace Q5_01 = 13 if S5_1A_C90=="Na construicao de uma escola melhor"
replace Q5_01 = 13 if S5_1A_C90=="Na construicao de uma escola no bairro da huamba porq na sua amaioria dos alunos sao daqui da huamba"
replace Q5_01 = 13 if S5_1A_C90=="na construicao de uma escola nova"
replace Q5_01 = 13 if S5_1A_C90=="Na construicao de uma escola nova de carater definitivo"
replace Q5_01 = 13 if S5_1A_C90=="Na construicao de uma escola nova de construicao definitiva"
replace Q5_01 = 13 if S5_1A_C90=="Na construicao de uma escolamelho"
replace Q5_01 = 13 if S5_1A_C90=="Na construicao de uma escolanova de carater definitivo"
replace Q5_01 = 13 if S5_1A_C90=="na construicao de uma nova escola"
replace Q5_01 = 13 if S5_1A_C90=="na construicao de uma nova escola de carater definitivo"
replace Q5_01 = 13 if S5_1A_C90=="Na construicao de uma outra escola"
replace Q5_01 = 13 if S5_1A_C90=="Na contruicao de uma escola de condicoes"
replace Q5_01 = 13 if S5_1A_C90=="Na organizacao da propria escola"
replace Q5_01 = 13 if S5_1A_C90=="Na reablitacao da escola"
replace Q5_01 = 13 if S5_1A_C90=="reabilitar a escola"
replace Q5_01 = 13 if S5_1A_C90=="remodelar a escola"
replace Q5_01 = 13 if S5_1A_C90=="REMODELAR A ESCOLA POR COMPLETO"
replace Q5_01 = 13 if S5_1A_C90=="TIRAR AS SALAS DE CHAPAS E CONSRTUIR DE BLOCO"
replace Q5_01 = 13 if S5_1A_C90=="todas areas"
replace Q5_01 = 14 if S5_1A_C90=="na construicao de um quintal nesta escola"
replace Q5_01 = 14 if S5_1A_C90=="um quintal"
replace Q5_01 = 15 if S5_1A_C90=="uma residencia para os professores."
replace Q5_01 = 16 if S5_1A_C90=="energia electruca para o ensino de adulto"
replace Q5_01 = 16 if S5_1A_C90=="gerador"
replace Q5_01 = 16 if S5_1A_C90=="LUZ ELETRICA"
replace Q5_01 = 17 if S5_1A_C90=="transporte escolar"
replace Q5_01 = 18 if S5_1A_C90=="pagamentos de guardas"
replace Q5_01 = 20 if S5_1A_C90=="çgua canalizada"

replace Q5_02 = 2 if S5_1B_C91=="casa de banho"
replace Q5_02 = 3 if S5_1B_C91=="no aumento de mas classe porque muitas genti fica sem estudar"
replace Q5_02 = 5 if S5_1B_C91=="calteiras e quadros"
replace Q5_02 = 5 if S5_1B_C91=="cateiras nas turma"
replace Q5_02 = 5 if S5_1B_C91=="COPIADORA"
replace Q5_02 = 5 if S5_1B_C91=="novas carteiras"
replace Q5_02 = 5 if S5_1B_C91=="quadros e carteias"
replace Q5_02 = 7 if S5_1B_C91=="pôr postos medicos para primeiro socorros."
replace Q5_02 = 7 if S5_1B_C91=="um centro medico"
replace Q5_02 = 7 if S5_1B_C91=="um centro medico proximo da e na contracao de mas professores"
replace Q5_02 = 7 if S5_1B_C91=="uma turma com computador para os alunosvda 6 classe"
replace Q5_02 = 7 if S5_1B_C91=="vassoras novas"
replace Q5_02 = 8 if S5_1B_C91=="Aumento de mas salas de aulas"
replace Q5_02 = 8 if S5_1B_C91=="nas contruincoes de mas salas de aulas"
replace Q5_02 = 8 if S5_1B_C91=="reparar as salas criticas"
replace Q5_02 = 13 if S5_1B_C91=="CONSTRUÇÃO DEFINITIVAS DA ESCOLANO BAIRRO"
replace Q5_02 = 13 if S5_1B_C91=="construir as escolas proximo das aldeias."
replace Q5_02 = 13 if S5_1B_C91=="fazer manutençao a escola"
replace Q5_02 = 13 if S5_1B_C91=="jannelas"
replace Q5_02 = 13 if S5_1B_C91=="Melhoria e qualidade de tal escolas"
replace Q5_02 = 13 if S5_1B_C91=="na construicao de uma outra escola"
replace Q5_02 = 13 if S5_1B_C91=="na reparacao da estrada que da asseco a escola"
replace Q5_02 = 13 if S5_1B_C91=="PORTA"
replace Q5_02 = 13 if S5_1B_C91=="PORTAS NOVAS"
replace Q5_02 = 13 if S5_1B_C91=="reparar a escola"
replace Q5_02 = 13 if S5_1B_C91=="uma escola das classe grande"
replace Q5_02 = 14 if S5_1B_C91=="CONSTRUÇAO DO MURO DA ESCOLA"
replace Q5_02 = 14 if S5_1B_C91=="CONTRUÇÃO DE UM QUINTAL"
replace Q5_02 = 14 if S5_1B_C91=="FAZER UM QUINTAL"
replace Q5_02 = 14 if S5_1B_C91=="quital"
replace Q5_02 = 14 if S5_1B_C91=="vedação da escola"
replace Q5_02 = 14 if S5_1B_C91=="vedar a escola com arame"
replace Q5_02 = 15 if S5_1B_C91=="CASAS PARA PROFESSORES"
replace Q5_02 = 15 if S5_1B_C91=="na construicao de uma casa para os professor"
replace Q5_02 = 15 if S5_1B_C91=="na reabilitacao da residencia dos professor"
replace Q5_02 = 15 if S5_1B_C91=="uma residencia para os professores"
replace Q5_02 = 16 if S5_1B_C91=="energia electrica na escola"
replace Q5_02 = 16 if S5_1B_C91=="GERADOR"
replace Q5_02 = 16 if S5_1B_C91=="Geradores para alfabetização de noite"
replace Q5_02 = 16 if S5_1B_C91=="luz electrica"
replace Q5_02 = 16 if S5_1B_C91=="luz na escola"
replace Q5_02 = 16 if S5_1B_C91=="na compra de um girador para ensino de adulto"
replace Q5_02 = 16 if S5_1B_C91=="na compra de um girrador para escola no ensino de adulto"
replace Q5_02 = 16 if S5_1B_C91=="na compra de um girrador para nos como encarregado estudarmos a noite"
replace Q5_02 = 16 if S5_1B_C91=="na escola tem que ter energia a popula presiza estudar a noite"
replace Q5_02 = 16 if S5_1B_C91=="no abastecimento de energia na escola"
replace Q5_02 = 16 if S5_1B_C91=="queremos energia para estudaremos no ensino de adulto"
replace Q5_02 = 17 if S5_1B_C91=="transporte para os professor"
replace Q5_02 = 18 if S5_1B_C91=="CERCA PARA A ESCOLA ESTAR EM SEGURANCA"
replace Q5_02 = 18 if S5_1B_C91=="segurança"
replace Q5_02 = 20 if S5_1B_C91=="AGUA"
replace Q5_02 = 20 if S5_1B_C91=="agua potavel"
replace Q5_02 = 20 if S5_1B_C91=="CONTRUIR UM TANQUE DE AGUA"
replace Q5_02 = 20 if S5_1B_C91=="um tanque para ter çgua"
replace Q5_02 = 21 if S5_1B_C91=="AUMENTO DO NIVEL ACADEMICO"
replace Q5_02 = 21 if S5_1B_C91=="no aumento de mas escola com classe elevada"

replace Q5_03 =20 if S5_1C_C92=="ABASTECIMENTO DÁGUA"
replace Q5_03 =20 if S5_1C_C92=="água na escola"
replace Q5_03 =20 if S5_1C_C92=="Contrucão de um tanque de água e uma vedação para a seguranca dos alunos"
replace Q5_03 =1 if S5_1C_C92=="CONTRUIR UM FONTNÁRIO"
replace Q5_03 =20 if S5_1C_C92=="na construicao de um tanqui"
replace Q5_03 =20 if S5_1C_C92=="na contruicao de um tanqui de agua"
replace Q5_03 =20 if S5_1C_C92=="Tanque de agua, espaço de lazer"
replace Q5_03 =3 if S5_1C_C92=="no aumento de mas classes para que os nossos filhos se dislocam para a comuna sede"
replace Q5_03 =4 if S5_1C_C92=="MERENDA ESCOLAR"
replace Q5_03 =4 if S5_1C_C92=="merendas escolares"
replace Q5_03 =4 if S5_1C_C92=="nesta escola antes davam merenda nas criancas agora ja nao"
replace Q5_03 =5 if S5_1C_C92=="ar condicionado"
replace Q5_03 =5 if S5_1C_C92=="carteias"
replace Q5_03 =5 if S5_1C_C92=="COMPRA DE MATERIAIS"
replace Q5_03 =5 if S5_1C_C92=="comprar material que facilitam a aprendisagem"
replace Q5_03 =5 if S5_1C_C92=="comprar quadros modernos"
replace Q5_03 =5 if S5_1C_C92=="No apretecheamento das propria escola"
replace Q5_03 =5 if S5_1C_C92=="NOVAS CARTEIRAS"
replace Q5_03 =5 if S5_1C_C92=="QUADRO D GIZ"
replace Q5_03 =6 if S5_1C_C92=="campo para educaçao fisica"
replace Q5_03 =7 if S5_1C_C92=="CENTRO MEDICO"
replace Q5_03 =7 if S5_1C_C92=="construçao de um campo"
replace Q5_03 =7 if S5_1C_C92=="E mais remedios para o posto medico"
replace Q5_03 =7 if S5_1C_C92=="FARMACIA"
replace Q5_03 =7 if S5_1C_C92=="na construicao de um campo de educacao fisica"
replace Q5_03 =8 if S5_1C_C92=="AUMENTO DA ESCOLA"
replace Q5_03 =8 if S5_1C_C92=="Aumento de mas classes"
replace Q5_03 =8 if S5_1C_C92=="JANELA"
replace Q5_03 =8 if S5_1C_C92=="na construicao de mas salas de aula"
replace Q5_03 =8 if S5_1C_C92=="no aumento de mas salas de aula"
replace Q5_03 =8 if S5_1C_C92=="No aumento de mas salas de aulas"
replace Q5_03 =8 if S5_1C_C92=="no aumento de mas uma escola com classe avansadas"
replace Q5_03 =13 if S5_1C_C92=="LUGAR DE LAZER PRA CRIANÇAS"
replace Q5_03 =13 if S5_1C_C92=="mudar o teto da escola"
replace Q5_03 =13 if S5_1C_C92=="murros na escola"
replace Q5_03 =13 if S5_1C_C92=="Na construicao de uma escola nova"
replace Q5_03 =13 if S5_1C_C92=="Na construicao de uma escola nova de carater definitivo"
replace Q5_03 =13 if S5_1C_C92=="Na construicao de uma escola nova de construicao definitiva"
replace Q5_03 =13 if S5_1C_C92=="portas"
replace Q5_03 =13 if S5_1C_C92=="queremos mais escolas."
replace Q5_03 =13 if S5_1C_C92=="REABILITAÇ√O DA ESCOLA"
replace Q5_03 =13 if S5_1C_C92=="reablitar a escola no geral"
replace Q5_03 =13 if S5_1C_C92=="RENOVAR A ESCOLA"
replace Q5_03 =13 if S5_1C_C92=="requalificar a estrada"
replace Q5_03 =13 if S5_1C_C92=="TIRAR AS SALAS DE BATE CHAPA E COLOCAR DE BLOCO"
replace Q5_03 =13 if S5_1C_C92=="UMA ESCOLA MAIOR"
replace Q5_03 =14 if S5_1C_C92=="FAZER QUINTAL D ESCOLA"
replace Q5_03 =14 if S5_1C_C92=="quital da escola"
replace Q5_03 =14 if S5_1C_C92=="VEDAR A ESCOLA"
replace Q5_03 =15 if S5_1C_C92=="na contruicao de uma casa para os professor"
replace Q5_03 =15 if S5_1C_C92=="resedencia para os professor"
replace Q5_03 =15 if S5_1C_C92=="residencia para os professor"
replace Q5_03 =15 if S5_1C_C92=="uma cas para os professores"
replace Q5_03 =15 if S5_1C_C92=="uma residencia para osprofessor"
replace Q5_03 =16 if S5_1C_C92=="COLOCAR LUZ"
replace Q5_03 =16 if S5_1C_C92=="energia da rede"
replace Q5_03 =16 if S5_1C_C92=="gerador"
replace Q5_03 =16 if S5_1C_C92=="luz"
replace Q5_03 =16 if S5_1C_C92=="termos energia na escola"
replace Q5_03 =17 if S5_1C_C92=="Precisa-se carro pa os professores"
replace Q5_03 =17 if S5_1C_C92=="Transporte para os professor"
replace Q5_03 =18 if S5_1C_C92=="CERCA PARA A SEGURANÇA DOS ALUNOS"
replace Q5_03 =18 if S5_1C_C92=="material escolar, segurança"
replace Q5_03 =18 if S5_1C_C92=="reforçar a segurança"
replace Q5_03 =18 if S5_1C_C92=="segurança"
replace Q5_03 =18 if S5_1C_C92=="SEGURANÇA DOS ALUNOS, A QUESTAO DA LIMPESA NA SCOLA"
replace Q5_03 =18 if S5_1C_C92=="SEGURANÇAS PARA A ESCOLA"
replace Q5_03 =19 if S5_1C_C92=="EMPREGADA DE LIMPEZA"
replace Q5_03 =19 if S5_1C_C92=="mais empregadas de limpesa"
replace Q5_03 =19 if S5_1C_C92=="PAGAR EMPREGADAS DE LIMPEZA"

lab var S5_1A_C90 "AUX"
lab var S5_1B_C91 "AUX"
lab var S5_1C_C92 "AUX"

order Q5_01 Q5_02 Q5_03 S5_1A_C90 S5_1B_C91 S5_1C_C92, after(S4_30)
}
********************************************************************************
********************************** SECTION 6 ***********************************
********************************************************************************
{
#delimit ;
lab def freq
1	"Very often"
2	"Often"
3	"Sometimes"
4	"Rarely"
5	"Never"
;
#delimit cr

rename S6_1_4_C(#)_Q1 Q6_0(#)

forval n=1/4{
replace Q6_0`n' = . if Q6_0`n'==6
lab val Q6_0`n' freq
}

lab var Q6_01 "How often do teachers give private classes to their own students?"
lab var Q6_02 "How often do teachers give private classes to other students?"
lab var Q6_03 "How often do parents ask the teacher of their child to give private classes?"
lab var Q6_04 "How often do parents ask another teacher to give private classes?"

lab var S6_5 "Have you paid private lessons for your child in the previous school year?"
rename S6_5 Q6_05
replace Q6_05 = 0 if Q6_05==2
lab val Q6_05 dummy

lab var S6_61 "Who gives currently or gave during the previous school year paid private lessons to your child?"
lab var S6_62 "Who gives currently or gave during the previous school year paid private lessons to your child?"
lab var S6_6_C6 "AUX"

rename S6_61 Q6_06_01
rename S6_62 Q6_06_02
replace Q6_06_01 = . if Q6_06_01==6
replace Q6_06_02 = . if Q6_06_02==6

replace Q6_05 = 0 if S6_6_C6=="nenguem"
replace Q6_05 = 0 if S6_6_C6=="O PAI"
replace Q6_06_01 = 5 if S6_6_C6=="madres na igreja"

replace Q6_06_02 = 4 if S6_6_C6=="jovem do bairro"

#delimit ;
lab def Q6_06
1	"Own teacher"
2	"Another teacher"
3	"Another teacher from another school"
4	"Friend/family"
5	"Pastor/catechist"
;
#delimit cr
lab val Q6_06_01 Q6_06_02 Q6_06

replace Q6_06_01 = . if Q6_05!=1
replace Q6_06_02 = . if Q6_05!=1


lab var S6_7 "How often did your child take paid private lessons in the previous school year?"
rename S6_7 Q6_07

#delimit ;
lab def Q6_07
1	"Daily"
2	"Several times a week"
3	"At least once a week"
4	"Once every two weeks"
5	"Once a month"
;
#delimit cr
lab val Q6_07 Q6_07

replace Q6_07 = . if Q6_05!=1

lab var S6_81 "AUX"
lab var S6_82 "AUX"
lab var S6_83 "AUX"
lab var S6_84 "AUX"
lab var S6_85 "AUX"
lab var S6_86 "AUX"
lab var S6_8_C6 "AUX"

gen Q6_08_01 = .
gen Q6_08_02 = .

replace Q6_08_01 = 1 if S6_81==1

replace Q6_08_01 = 2 if S6_82==1 & Q6_08_01==.
replace Q6_08_02 = 2 if S6_82==1 & Q6_08_01!=2

replace Q6_08_01 = 3 if S6_83==1 & Q6_08_01==.
replace Q6_08_02 = 3 if S6_83==1 & Q6_08_01!=3

replace Q6_08_01 = 4 if S6_84==1 & Q6_08_01==.
replace Q6_08_02 = 4 if S6_84==1 & Q6_08_01!=4

replace Q6_08_01 = 5 if S6_85==1 & Q6_08_01==.
replace Q6_08_02 = 5 if S6_85==1 & Q6_08_01!=5


replace Q6_08_01 = 6 if S6_8_C6=="CASA MÃE" & Q6_08_01==.
replace Q6_08_02 = 6 if S6_8_C6=="CASA MÃE" & Q6_08_01!=6

replace Q6_08_01 = 6 if S6_8_C6=="FAMILIAR" & Q6_08_01==.
replace Q6_08_02 = 6 if S6_8_C6=="FAMILIAR" & Q6_08_01!=6

replace Q6_08_01 = 6 if S6_8_C6=="casa do amigo" & Q6_08_01==.
replace Q6_08_02 = 6 if S6_8_C6=="casa do amigo" & Q6_08_01!=6

replace Q6_08_01 = 7 if S6_8_C6=="espaço arrendado" & Q6_08_01==.
replace Q6_08_02 = 7 if S6_8_C6=="espaço arrendado" & Q6_08_01!=7

replace Q6_08_01 = 4 if S6_8_C6=="local onde as madres vivem" & Q6_08_01==.
replace Q6_08_02 = 4 if S6_8_C6=="local onde as madres vivem" & Q6_08_01!=4

lab var Q6_08_01 "(1) Location of private classes"
lab var Q6_08_02 "(2) Location of private classes"

#delimit ;
;
lab def Q6_08
1	"School"
2	"Home teacher"
3	"Home student"
4	"Church"
5	"Community building"
6	"House family or friend"
7	"Rented space"
;
lab val Q6_08_01 Q6_08_02 Q6_08;
#delimit cr

replace Q6_08_01 = . if Q6_05!=1
replace Q6_08_02 = . if Q6_05!=1

order Q6_08_01 Q6_08_02, after(Q6_07)

lab var S6_9 "How much do you pay or are you paying on an hourly basis on average?"
rename S6_9 Q6_09
replace Q6_09 = . if Q6_05!=1

lab var S6_10 "How much did you pay per month, on average, for private lessons for the {# P3} in the previous school year?"
rename S6_10 Q6_10
replace Q6_10 = . if Q6_05!=1

/* questions 9 and 10 have many zeros that means one is not paying or maybe they
didnt know how much. Also again very unrealistic low numbers, these could
be thousands. */

rename S6_11_C1_Q1	Q6_11_01_money
rename S6_11_C1_Q2	Q6_11_01_gift
rename S6_11_C1_Q3	Q6_11_01_service

recode Q6_11_01_money (2=0)
recode Q6_11_01_gift (2=0)
recode Q6_11_01_service (2=0)

lab val Q6_11_01_money Q6_11_01_gift Q6_11_01_service dummy

rename S6_11_C1_Q1_Dinh 	Q6_11_02_money
rename S6_11_C1_Q2_Present 	Q6_11_02_gift
rename S6_11_C1_Q3_Horas 	Q6_11_02_service

lab var Q6_11_01_money 			"Gave a present to teacher in the form of money during the last year"
lab var Q6_11_01_gift 			"Gave a present to teacher in the form of an object during the last year"
lab var Q6_11_01_service 		"Gave a present to teacher in the form of a service during the last year"
lab var Q6_11_02_money 			"Value of monitary present"
lab var Q6_11_02_gift 			"Number of objects received as present"
lab var Q6_11_02_service 		"Hours of service received as present"

replace Q6_11_02_money = . if Q6_11_01_money!=1
replace Q6_11_02_gift = . if Q6_11_01_gift!=1
replace Q6_11_02_service = . if Q6_11_01_service!=1

#delimit;
lab def Q6_1213
1	"Daily or almost daily"
2	"Several times per week"
3	"Once a week"
4	"Once every two weeks"
5	"Less than once every two weeks"
6	"Never"
;
#delimit cr

lab var S6_12 		"In the last two weeks, how often did you or an adult in your household help your child with homework assignments?"
lab var S6_12_C5 	"AUX"
rename S6_12 Q6_12
lab val Q6_12 Q6_1213
replace Q6_12 = . if Q6_12==5

replace Q6_12 = 1 if S6_12_C5=="quase sempre"
replace Q6_12 = 1 if S6_12_C5=="sempre"
replace Q6_12 = 5 if S6_12_C5=="AGUMAS VEZES"
replace Q6_12 = 5 if S6_12_C5=="ALGUMAS VEZES"
replace Q6_12 = 5 if S6_12_C5=="as vezes"
replace Q6_12 = 5 if S6_12_C5=="nas vezes"
replace Q6_12 = 5 if S6_12_C5=="nem sempre"
replace Q6_12 = 6 if S6_12_C5=="NA8"
replace Q6_12 = 6 if S6_12_C5=="nao"
replace Q6_12 = 6 if S6_12_C5=="não"
replace Q6_12 = 6 if S6_12_C5=="NAO ACONTECE"
replace Q6_12 = 6 if S6_12_C5=="não ajudo"
replace Q6_12 = 6 if S6_12_C5=="NAO conntece"
replace Q6_12 = 6 if S6_12_C5=="NÃO O AJUDA"
replace Q6_12 = 6 if S6_12_C5=="não sei"
replace Q6_12 = 6 if S6_12_C5=="nao tem ajudado"
replace Q6_12 = 6 if S6_12_C5=="NAO TEVE"
replace Q6_12 = 6 if S6_12_C5=="Nenhuma vez"
replace Q6_12 = 6 if S6_12_C5=="ninguem ajugou"
replace Q6_12 = 6 if S6_12_C5=="nuca"
replace Q6_12 = 6 if S6_12_C5=="nuca ajudo"
replace Q6_12 = 6 if S6_12_C5=="nuca fez isso"
replace Q6_12 = 6 if S6_12_C5=="numa vez"
replace Q6_12 = 6 if S6_12_C5=="nunca"
replace Q6_12 = 6 if S6_12_C5=="nunca ajudaram"
replace Q6_12 = 6 if S6_12_C5=="Nunca ajudou"
replace Q6_12 = 6 if S6_12_C5=="nunca foi ajudado"

lab var S6_13 		"Last month, how often did all the members of your household sit down and eat?"
lab var S6_13_C5 	"AUX"
rename S6_13 Q6_13
lab val Q6_13 Q6_1213
replace Q6_13 = . if Q6_13==5

replace Q6_13 = 1 if S6_13_C5=="Sempre"
replace Q6_13 = 2 if S6_13_C5=="2 vezes por semana"
replace Q6_13 = 3 if S6_13_C5=="no fim de seman"
replace Q6_13 = 5 if S6_13_C5=="1 aniversario"
replace Q6_13 = 5 if S6_13_C5=="2 vezes por ano"
replace Q6_13 = 5 if S6_13_C5=="ALGUMAS VEZES"
replace Q6_13 = 5 if S6_13_C5=="aniversario"
replace Q6_13 = 5 if S6_13_C5=="as vezes"
replace Q6_13 = 5 if S6_13_C5=="cinco vezes por ano"
replace Q6_13 = 5 if S6_13_C5=="de vez em quanto"
replace Q6_13 = 5 if S6_13_C5=="uma vez"
replace Q6_13 = 6 if S6_13_C5=="isso aqui não acontece."
replace Q6_13 = 6 if S6_13_C5=="nada"
replace Q6_13 = 6 if S6_13_C5=="nada se comemoro"
replace Q6_13 = 6 if S6_13_C5=="nao"
replace Q6_13 = 6 if S6_13_C5=="não"
replace Q6_13 = 6 if S6_13_C5=="NAO ACONTECE"
replace Q6_13 = 6 if S6_13_C5=="NAO ACONTECEM"
replace Q6_13 = 6 if S6_13_C5=="não comemoramos."
replace Q6_13 = 6 if S6_13_C5=="não se comemorou"
replace Q6_13 = 6 if S6_13_C5=="não se comorou nada"
replace Q6_13 = 6 if S6_13_C5=="NAO TEVE"
replace Q6_13 = 6 if S6_13_C5=="nenhum"
replace Q6_13 = 6 if S6_13_C5=="nenhum dia"
replace Q6_13 = 6 if S6_13_C5=="nenhuma"
replace Q6_13 = 6 if S6_13_C5=="nós aqui é muito dificil vestejar."
replace Q6_13 = 6 if S6_13_C5=="nuca"
replace Q6_13 = 6 if S6_13_C5=="nuca fez isso"
replace Q6_13 = 6 if S6_13_C5=="nunca"

lab var S6_14_C1_Q1 "Happens how often?: Parents give money or gifts to the director/teacher to ensure that their children can enroll"
lab var S6_14_C2_Q1 "Happens how often?: Parents give money or gifts to the director/teacher to ensure that their children pass exams or to increase their grades"
lab var S6_14_C3_Q1 "Happens how often?: The members of the school board are involved in activities that seem corrupt"
lab var S6_14_C4_Q1 "Happens how often?: Teachers have to offer money or gifts to secure a job at school"
lab var S6_14_C5_Q1 "Happens how often?: Teachers pay or offer gifts to move to a school closer to home or with better conditions"

rename S6_14_C(#)_Q1 Q6_14_0(#)

forval n=1/5{
recode Q6_14_0`n' (6=.)
lab val Q6_14_0`n' freq
}

lab var S6_15_C1_Q1 "Do you agree?: Private classes help students to better understand the subjects of the program"
lab var S6_15_C2_Q1 "Do you agree?: Private lessons give an unfair advantage to students who can pay for these services"
lab var S6_15_C3_Q1 "Do you agree?: Private lessons give rise to an unfair school classification and may therefore be considered as a corrupt practice"
lab var S6_15_C4_Q1 "Do you agree?: If the state increases teachers' salaries, the need for them to give private lessons will decrease"

rename S6_15_C(#)_Q1 Q6_15_0(#)

#delimit ;
;
lab def agree
1	"Totally agree"
2	"Agree"
3	"Not agree nor disagree"
4	"Disagree"
5	"Totally disagree"
;
#delimit cr

lab val Q6_15_01 Q6_15_02 Q6_15_03 Q6_15_04 agree

lab var S6_16_C1_Q1 "Happens how often?: Improper appropriation of funds for the construction/improvement of school infrastructure or diversion of these funds to other uses than those stipulated"
lab var S6_16_C2_Q1 "Happens how often?: Misappropriation of the salaries of teachers / school employees or diversion of these funds to other uses than those stipulated"
lab var S6_16_C3_Q1 "Happens how often?: Misappropriation of funds for subsidies for school books or diversion of such funds to uses other than those stipulated"
lab var S6_16_C4_Q1 "Happens how often?: Improper appropriation by the director/teacher of school books sent by the Ministry of Education and subsequently sold, when they should be delivered free of charge to the pupils"

rename S6_16_C(#)_Q1 Q6_16_0(#)
forval n=1/4{
recode Q6_16_0`n' (6=.)
lab val Q6_16_0`n' freq
}

order S6_6_C6 S6_81 S6_82 S6_83 S6_84 S6_85 S6_86 S6_8_C6 S6_12_C5 S6_13_C5, after(Q6_16_04)
}
********************************************************************************
********************************** SECTION 7 ***********************************
********************************************************************************
{
lab var S7_1_C1_Q1 "The motivation of the teachers of this school is high"
lab var S7_1_C2_Q1 "Teachers work with enthusiasm"
lab var S7_1_C3_Q1 "Teachers are proud of this school"
lab var S7_1_C4_Q1 "Teachers value student achievement"

rename S7_1_C(#)_Q1 Q7_0(#)

forval n=1/4{
replace Q7_0`n' = . if Q7_0`n'==6
lab val Q7_0`n' agree
}

lab var S7_5 "Overall, how satisfied are you with the teacher's performance of your child?"
lab var S7_61 "What is the first main reason why you are dissatisfied with the teacher's performance?"
lab var S7_62 "What is the second main reason why you are dissatisfied with the teacher's performance?"
lab var S7_6_C10 "AUX"

rename S7_5 Q7_05
lab val Q7_05 satisfied

rename S7_61 Q7_06_01
rename S7_62 Q7_06_02

replace Q7_06_02 = . if Q7_06_02==10
replace Q7_06_02 = 4 if S7_6_C10=="o professor bate os alunos."
replace Q7_06_02 = 5 if S7_6_C10=="e os professores faltam muito."
replace Q7_06_02 = 5 if S7_6_C10=="entrou tarde"
replace Q7_06_02 = 5 if S7_6_C10=="falta muito"
replace Q7_06_02 = 5 if S7_6_C10=="falta muito."
replace Q7_06_02 = 5 if S7_6_C10=="faltam demais"
replace Q7_06_02 = 5 if S7_6_C10=="faltam muito."
replace Q7_06_02 = 5 if S7_6_C10=="porque faltammuito."
replace Q7_06_02 = 5 if S7_6_C10=="porque faltam muito e vivem distante da aldeia."

#delimit;
lab def Q7_06
1	"Lack of dedication and effort"
2	"Poor qualifications"
3	"Weak teaching methods"
4	"Corrective methods too hard (for example: hitting of students)"
5	"High absenteeism"
6	"The student does not like him/her"
7	"He/She requires private tuition"
8	"There is corruption in exchange for better rankings"
9	"Sexual harassment"
;
#delimit cr
lab val Q7_06_01 Q7_06_02 Q7_06

lab var S7_7 "Overall, how satisfied are you with the performance of the school?"

rename S7_7 Q7_07
lab val Q7_07 satisfied

lab var S7_81 "What is the first main reasons why you are dissatisfied with the performance of the school?"
lab var S7_82 "What is the second main reasons why you are dissatisfied with the performance of the school?"
lab var S7_8_C10 "AUX"

rename S7_81 Q7_08_01
rename S7_82 Q7_08_02

replace Q7_08_02 = . if Q7_08_02==10

#delimit;
lab def Q7_08
1	"Poor teaching quality"
2	"Weak equipment in classrooms"
3	"School building and other facilities in a bad state"
4	"Lack of sanitary facilities separated by gender"
5	"Lack of schoolbooks"
6	"The costs for going to school are very large"
7	"It is far"
8	"The student does not like the school"
9	"You have to pay to answer any questions individually"
10	"Lack of professors"
;
#delimit cr
lab val Q7_08_01 Q7_08_02 Q7_08

replace Q7_08_02 = 3 if S7_8_C10=="sala de chapas e elavam bancos para se sentarem"
replace Q7_08_02 = 3 if S7_8_C10=="falta de qualidade das salas."
replace Q7_08_02 = 3 if S7_8_C10=="falta de mais escola"
replace Q7_08_02 = 10 if S7_8_C10=="falta de professores."
replace Q7_08_02 = 3 if S7_8_C10=="tudo antigo ate as paredes."
replace Q7_08_02 = 3 if S7_8_C10=="a escola é pessima."
replace Q7_08_02 = 3 if S7_8_C10=="a escola esta em mau estado."
replace Q7_08_02 = 3 if S7_8_C10=="por causa das mç condições das calteiras, pintura, quadros e portas."
replace Q7_08_02 = 3 if S7_8_C10=="porque falta nova pintura,portas, turmas..."
replace Q7_08_02 = 3 if S7_8_C10=="mç qualidade se salas e poras"
replace Q7_08_02 = 3 if S7_8_C10=="escola esta cair."
replace Q7_08_02 = 3 if S7_8_C10=="mç qualidade da escola"

order S7_6_C10 S7_8_C10, after(Q7_08_02)
}
********************************************************************************
********************************** SECTION 8 ***********************************
********************************************************************************
{
lab var S8_1_C1_Q1 "Generally speaking, how often do you think school principals are assigned to certain schools because of political or personal relationships rather than their qualifications?"
lab var S8_1_C2_Q1 "Generally speaking, how often do you think school principals offer money or favors to be assigned to a specific school?"
lab var S8_1_C3_Q1 "Generally speaking, how often do you think teachers are assigned to certain schools because of political or personal relationships rather than their qualifications?"
lab var S8_1_C4_Q1 "Generally speaking, how often do you think teachers offer money or favors to be assigned to a specific school?"

rename S8_1_C(#)_Q1 Q8_0(#)
forval n=1/4{
replace Q8_0`n' = . if Q8_0`n'==6
lab val Q8_0`n' freq
}
lab var S8_5 "Would you be in favor of a school reform that would give the management the power to participate in the hiring and firing of the principal?"
rename S8_5 Q8_05
recode Q8_05 (2=0)
lab val Q8_05 dummy

drop S8_61 S8_62
lab var S8_6_C1 "First reason not in favor of the reform in Q8_05"
lab var S8_6_C2 "Second reason not in favor of the reform in Q8_05"
rename S8_6_C1 Q8_06_01
rename S8_6_C2 Q8_06_02

lab var S8_7 "Would you be in favor of a school reform that would give the principal and teachers the power to participate in hiring and firing teachers?"
rename S8_7 Q8_07
recode Q8_07 (2=0)
lab val Q8_07 dummy

drop S8_81 S8_82
lab var S8_8_C1 "First reason not in favor of the reform in Q8_07"
lab var S8_8_C2 "Second reason not in favor of the reform in Q8_07"
rename S8_8_C1 Q8_08_01
rename S8_8_C2 Q8_08_02

lab var S8_9 "Is there anything that you would like to see changed in the functioning of the school or in the educational services of the municipality?"
rename S8_9 Q8_09
recode Q8_09 (2=0)
lab val Q8_09 dummy

lab var S8_10 "What would you like to see changed?"
rename S8_10 Q8_10

lab var S8_11 "Have you ever presented a criticism, complaint or suggestion concerning educational services in the municipality in the last 2 years?"
rename S8_11 Q8_11
recode Q8_11 (2=0)
lab val Q8_11 dummy

lab var S8_12 "Why did not you submit a criticism, complaint or suggestion?"
rename S8_12 Q8_12
replace Q8_12 = . if Q8_12==5
#delimit;
lab def Q8_12
1 "There was no reason for criticism, complaint or suggestion."
2 "Being afraid"
3 "It was not worth it"
4 "The question was put by another person"
5 "Did not have the opportunity, or do not know how"
;
#delimit cr
lab val Q8_12 Q8_12
lab var S8_12_C5 "AUX"

replace Q8_12 = 1 if S8_12_C5=="nao foi nessario"
replace Q8_12 = 1 if S8_12_C5=="porque a maneira qui os professores estam ensinar esta muitobom."
replace Q8_12 = 1 if S8_12_C5=="porque não notei falhas ainda"
replace Q8_12 = 1 if S8_12_C5=="porque ninguem vai ligar"
replace Q8_12 = 1 if S8_12_C5=="porque nunca tive assunto pra criticar"
replace Q8_12 = 1 if S8_12_C5=="tudo esta correr bem"
replace Q8_12 = 5 if S8_12_C5=="falta de oportunidade"
replace Q8_12 = 5 if S8_12_C5=="FALTA DE PREVILÉGIO"
replace Q8_12 = 5 if S8_12_C5=="não ouve registo"
replace Q8_12 = 5 if S8_12_C5=="nao sabe a quem recorrer"
replace Q8_12 = 5 if S8_12_C5=="nao tenho como"
replace Q8_12 = 5 if S8_12_C5=="não teve oportunidade"
replace Q8_12 = 5 if S8_12_C5=="NAO TINHA OPORTUNIDADE"
replace Q8_12 = 5 if S8_12_C5=="nunca teve a oportunidade"
replace Q8_12 = 5 if S8_12_C5=="nunca teve oportnidade"
replace Q8_12 = 5 if S8_12_C5=="nunca tive em um debate que se falou da educação"
replace Q8_12 = 5 if S8_12_C5=="porque não participo nas reuniões"
replace Q8_12 = 5 if S8_12_C5=="porque nunca tivemos reunião com um tema que fala sobre a educação"
replace Q8_12 = 5 if S8_12_C5=="SEM OPORTUNIDADA"
replace Q8_12 = 5 if S8_12_C5=="nunca fui alvo de reúniõs"
replace Q8_12 = 5 if S8_12_C5=="nunca reunemos"
replace Q8_12 = 5 if S8_12_C5=="nunca reuniram"
replace Q8_12 = 5 if S8_12_C5=="FALTA DE TEMPO"
replace Q8_12 = 5 if S8_12_C5=="NAO TENHO TEMPO"

lab var S8_13 "So far as you know, are there mechanisms for presenting such criticisms, complaints or suggestions?"
rename S8_13 Q8_13
recode Q8_13 (2=0)
lab val Q8_13 dummy

lab var S8_1401 "Talked to the school director"
lab var S8_1402 "Talked to the school board"
lab var S8_1403 "Talked to other school elements"
lab var S8_1404 "You left a suggestion in the suggestion box at the school or in a public body"
lab var S8_1405 "Through the municipal/provincial education board"
lab var S8_1406 "In a forum with those responsible at the commune/municipality level"
lab var S8_1407 "Talked to the media (for example: radio, TV, newspaper)"
lab var S8_1408 "In a forum with an NGO"
lab var S8_1409 "In a forum in the community/church"

rename S8_14(##) Q8_14_(##)
foreach var in Q8_14_01 Q8_14_02 Q8_14_03 Q8_14_04 Q8_14_05 Q8_14_06 Q8_14_07 Q8_14_08 Q8_14_09 Q8_14_10{
lab val `var' dummy
replace `var'=. if Q8_11!=1
}
rename Q8_14_10 S8_1410

replace Q8_14_03=1 if S8_14_C10=="Com a comição"
replace Q8_14_03=1 if S8_14_C10=="AO PROFESSOR"
replace Q8_14_06=1 if S8_14_C10=="coordenador do kicombo"
replace Q8_14_06=1 if S8_14_C10=="APRESENTAMOS NO SOBA"

egen tot = rowtotal(Q8_14_01 Q8_14_02 Q8_14_03 Q8_14_04 Q8_14_05 Q8_14_06 Q8_14_07 Q8_14_08 Q8_14_09), missing
foreach var in Q8_14_01 Q8_14_02 Q8_14_03 Q8_14_04 Q8_14_05 Q8_14_06 Q8_14_07 Q8_14_08 Q8_14_09{
replace `var'=. if tot==0
}
drop tot

replace Q8_11=0 if S8_14_C10=="Não apresentou"

lab var S8_1410 "AUX"
lab var S8_14_C10 "AUX"

lab var S8_15 "Satisfied with the response to criticisms, complaints and suggestions"
rename S8_15 Q8_15
replace Q8_15 = . if Q8_15==3
recode Q8_15 (2=0)
lab val Q8_15 dummy

lab var S8_16 "Why are you not satisfied?"
rename S8_16 Q8_16

order S8_12_C5 S8_1410 S8_14_C10, after(Q8_16)
}
********************************************************************************
********************************** SECTION 9 ***********************************
********************************************************************************
{
lab var S9_1_C1_Q1 "Parents in my community still do not understand the benefits that education has in their children's lives"
lab var S9_1_C2_Q1 "There is a great advantage in sending my children to school, since education will help them to find a better job when they grow up"
rename S9_1_C1_Q1 Q9_01
rename S9_1_C2_Q1 Q9_02
replace Q9_01 = . if Q9_01==6
replace Q9_02 = . if Q9_02==6
lab val Q9_01 Q9_02 agree

lab var S9_3 "Do you think most people would try to be selfish if they had a chance or would they try to be fair?"
lab var S9_4 "Do you generally believe that people are trustworthy or think that 'all care is little'?"
rename S9_3 Q9_03
rename S9_4 Q9_04
replace Q9_03 = . if Q9_03==3
replace Q9_04 = . if Q9_04==3

#delimit;
lab def Q9_03
1 "They would try to be selfish"
2 "They would try to be fair"
;
lab def Q9_04
1 "They are trustworthy"
2 "'All care is little'"
;
#delimit cr
lab val Q9_03 Q9_03
lab val Q9_04 Q9_04

lab var S9_8 				"Do you disagree because the salary is too high or too low?"
rename S9_8 Q9_08
lab def Q9_08 1 "Too high" 2 "Too low"
lab val Q9_08 Q9_08

lab var S9_5_C1_Q1 "Teachers take their responsibilities to the students very seriously"
lab var S9_5_C2_Q1 "The better a child's education, the more success she will have when she reaches adulthood"
lab var S9_5_C3_Q1 "Teachers receive a fair wage for what they do"

lab var S9_5A_C4_Q1 "School principals take their responsibilities to the students very seriously"
lab var S9_5A_C5_Q1 "The teachers are, in general, demoralized"
lab var S9_5A_C6_Q1 "Teachers can not be criticized for giving explanations to their own students - they have to earn a living in some way"
lab var S9_5A_C7_Q1 "Teachers can not be criticized for doing odd jobs out of school - they have to earn a living in some way"
lab var S9_5A_C8_Q1 "Teachers can not be criticized for giving explanations to their own students because there are too few class hours and too many students to cover all the subjects in the program"
lab var S9_5A_C9_Q1 "Parents/guardians can not be criticized for paying their children's explanations - they are concerned about the results achieved by their children"

rename S9_5_C1_Q1	Q9_05
rename S9_5_C2_Q1 	Q9_06
rename S9_5_C3_Q1	Q9_07

rename S9_5A_C4_Q1 	Q9_09
rename S9_5A_C5_Q1 	Q9_10
rename S9_5A_C6_Q1 	Q9_11
rename S9_5A_C7_Q1 	Q9_12
rename S9_5A_C8_Q1 	Q9_13
rename S9_5A_C9_Q1	Q9_14

foreach var in Q9_05 Q9_06 Q9_07 Q9_09 Q9_10 Q9_11 Q9_12 Q9_13 Q9_14{
replace `var' = . if `var'==6
lab val `var' agree
}
}
********************************************************************************
********************************** SECTION 10 **********************************
********************************************************************************
{
lab var S10_1 "Do you belong to any club, community-based organization, economic organization (such as kixikila groups), church or other social group in the community?"
lab var S10_2 "How many of these groups do you belong to?"

rename S10_1 Q10_01
recode Q10_01 (2=0)
lab val Q10_01 dummy

rename S10_2 Q10_02
replace Q10_01 = 0 if S10_3_0_S10_3_0=="INE"
replace Q10_02 = . if Q10_01!=1
replace Q10_02 = . if Q10_02==0
replace Q10_02 = 1 if inlist(Q10_02,7,10)
replace Q10_02 = 2 if Q10_02==6

forval n=5/10{
drop S10_3_`n'_S10_3_0
drop S10_3_`n'_S10_4
drop S10_3_`n'_S10_4_C13
drop S10_3_`n'_S10_5
drop S10_3_`n'_S10_6
drop S10_3_`n'_S10_7
drop S10_3_`n'_S10_7_C2
drop S10_3_`n'_S10_7_C6
drop S10_3_`n'_S10_8
drop S10_3_`n'_S10_9
drop S10_3_`n'_S10_10
drop S10_3_`n'_S10_11
drop S10_3_`n'_S10_11_C9
}

forval n=0/4{
tostring S10_3_`n'_S10_4_C13,replace
tostring S10_3_`n'_S10_7_C2,replace
tostring S10_3_`n'_S10_7_C6,replace
tostring S10_3_`n'_S10_11_C9,replace
}

forval n=0/4{
replace S10_3_`n'_S10_3_0 		= "" 	if Q10_02==.
replace S10_3_`n'_S10_4 		= . 	if Q10_02==.
replace S10_3_`n'_S10_4_C13 	= "" 	if Q10_02==.
replace S10_3_`n'_S10_5 		= . 	if Q10_02==.
replace S10_3_`n'_S10_6 		= . 	if Q10_02==.
replace S10_3_`n'_S10_7 		= . 	if Q10_02==.
replace S10_3_`n'_S10_7_C2 		= "" 	if Q10_02==.
replace S10_3_`n'_S10_7_C6 		= "" 	if Q10_02==.
replace S10_3_`n'_S10_8 		= . 	if Q10_02==.
replace S10_3_`n'_S10_9 		= . 	if Q10_02==.
replace S10_3_`n'_S10_10 		= . 	if Q10_02==.
replace S10_3_`n'_S10_11 		= . 	if Q10_02==.
replace S10_3_`n'_S10_11_C9		= "" 	if Q10_02==.
}

forval n=1/4{
replace S10_3_`n'_S10_3_0 		= "" 	if Q10_02==1
replace S10_3_`n'_S10_4 		= . 	if Q10_02==1
replace S10_3_`n'_S10_4_C13 	= "" 	if Q10_02==1
replace S10_3_`n'_S10_5 		= . 	if Q10_02==1
replace S10_3_`n'_S10_6 		= . 	if Q10_02==1
replace S10_3_`n'_S10_7 		= . 	if Q10_02==1
replace S10_3_`n'_S10_7_C2 		= "" 	if Q10_02==1
replace S10_3_`n'_S10_7_C6 		= "" 	if Q10_02==1
replace S10_3_`n'_S10_8 		= . 	if Q10_02==1
replace S10_3_`n'_S10_9 		= . 	if Q10_02==1
replace S10_3_`n'_S10_10 		= . 	if Q10_02==1
replace S10_3_`n'_S10_11 		= . 	if Q10_02==1
replace S10_3_`n'_S10_11_C9		= "" 	if Q10_02==1
}

forval n=2/4{
replace S10_3_`n'_S10_3_0 		= "" 	if Q10_02==2
replace S10_3_`n'_S10_4 		= . 	if Q10_02==2
replace S10_3_`n'_S10_4_C13 	= "" 	if Q10_02==2
replace S10_3_`n'_S10_5 		= . 	if Q10_02==2
replace S10_3_`n'_S10_6 		= . 	if Q10_02==2
replace S10_3_`n'_S10_7 		= . 	if Q10_02==2
replace S10_3_`n'_S10_7_C2 		= "" 	if Q10_02==2
replace S10_3_`n'_S10_7_C6 		= "" 	if Q10_02==2
replace S10_3_`n'_S10_8 		= . 	if Q10_02==2
replace S10_3_`n'_S10_9 		= . 	if Q10_02==2
replace S10_3_`n'_S10_10 		= . 	if Q10_02==2
replace S10_3_`n'_S10_11 		= . 	if Q10_02==2
replace S10_3_`n'_S10_11_C9		= "" 	if Q10_02==2
}

drop S10_3_1_S10_4_C13 S10_3_2_S10_4_C13 S10_3_3_S10_4_C13 S10_3_4_S10_4_C13
drop S10_3_0_S10_7_C2 S10_3_2_S10_7_C2 S10_3_3_S10_7_C2 S10_3_4_S10_7_C2
drop S10_3_1_S10_7_C6 S10_3_2_S10_7_C6 S10_3_3_S10_7_C6 S10_3_4_S10_7_C6
drop S10_3_2_S10_11_C9 S10_3_3_S10_11_C9 S10_3_4_S10_11_C9

rename S10_3_0_S10_3_0 Q10_03_01
rename S10_3_1_S10_3_0 Q10_03_02
rename S10_3_2_S10_3_0 Q10_03_03
rename S10_3_3_S10_3_0 Q10_03_04
rename S10_3_4_S10_3_0 Q10_03_05

rename S10_3_0_S10_4 Q10_04_01
rename S10_3_1_S10_4 Q10_04_02
rename S10_3_2_S10_4 Q10_04_03
rename S10_3_3_S10_4 Q10_04_04
rename S10_3_4_S10_4 Q10_04_05

rename S10_3_0_S10_5 Q10_05_01
rename S10_3_1_S10_5 Q10_05_02
rename S10_3_2_S10_5 Q10_05_03
rename S10_3_3_S10_5 Q10_05_04
rename S10_3_4_S10_5 Q10_05_05

rename S10_3_0_S10_6 Q10_06_01
rename S10_3_1_S10_6 Q10_06_02
rename S10_3_2_S10_6 Q10_06_03
rename S10_3_3_S10_6 Q10_06_04
rename S10_3_4_S10_6 Q10_06_05

rename S10_3_0_S10_7 Q10_07_01
rename S10_3_1_S10_7 Q10_07_02
rename S10_3_2_S10_7 Q10_07_03
rename S10_3_3_S10_7 Q10_07_04
rename S10_3_4_S10_7 Q10_07_05

rename S10_3_0_S10_8 Q10_08_01
rename S10_3_1_S10_8 Q10_08_02
rename S10_3_2_S10_8 Q10_08_03
rename S10_3_3_S10_8 Q10_08_04
rename S10_3_4_S10_8 Q10_08_05

rename S10_3_0_S10_9 Q10_09_01
rename S10_3_1_S10_9 Q10_09_02
rename S10_3_2_S10_9 Q10_09_03
rename S10_3_3_S10_9 Q10_09_04
rename S10_3_4_S10_9 Q10_09_05

rename S10_3_0_S10_10 Q10_10_01
rename S10_3_1_S10_10 Q10_10_02
rename S10_3_2_S10_10 Q10_10_03
rename S10_3_3_S10_10 Q10_10_04
rename S10_3_4_S10_10 Q10_10_05

rename S10_3_0_S10_11 Q10_11_01
rename S10_3_1_S10_11 Q10_11_02
rename S10_3_2_S10_11 Q10_11_03
rename S10_3_3_S10_11 Q10_11_04
rename S10_3_4_S10_11 Q10_11_05

lab var Q10_03_01 "(1) What is the name of the organization?"
lab var Q10_03_02 "(2) What is the name of the organization?"
lab var Q10_03_03 "(3) What is the name of the organization?"
lab var Q10_03_04 "(4) What is the name of the organization?"
lab var Q10_03_05 "(5) What is the name of the organization?"

lab var Q10_04_01 "(1) What kind of group is the organization?"
lab var Q10_04_02 "(2) What kind of group is the organization?"
lab var Q10_04_03 "(3) What kind of group is the organization?"
lab var Q10_04_04 "(4) What kind of group is the organization?"
lab var Q10_04_05 "(5) What kind of group is the organization?"

lab var Q10_05_01 "(1) How many members does the organization have in this location?"
lab var Q10_05_02 "(2) How many members does the organization have in this location?"
lab var Q10_05_03 "(3) How many members does the organization have in this location?"
lab var Q10_05_04 "(4) How many members does the organization have in this location?"
lab var Q10_05_05 "(5) How many members does the organization have in this location?"

lab var Q10_06_01 "(1) Do you hold a leading position in this group?"
lab var Q10_06_02 "(2) Do you hold a leading position in this group?"
lab var Q10_06_03 "(3) Do you hold a leading position in this group?"
lab var Q10_06_04 "(4) Do you hold a leading position in this group?"
lab var Q10_06_05 "(5) Do you hold a leading position in this group?"

lab var Q10_07_01 "(1) Where is the organization located?"
lab var Q10_07_02 "(2) Where is the organization located?"
lab var Q10_07_03 "(3) Where is the organization located?"
lab var Q10_07_04 "(4) Where is the organization located?"
lab var Q10_07_05 "(5) Where is the organization located?"

lab var Q10_08_01 "(1) Are the members of the organization all of this commune?"
lab var Q10_08_02 "(2) Are the members of the organization all of this commune?"
lab var Q10_08_03 "(3) Are the members of the organization all of this commune?"
lab var Q10_08_04 "(4) Are the members of the organization all of this commune?"
lab var Q10_08_05 "(5) Are the members of the organization all of this commune?"

lab var Q10_09_01 "(1) Since when does this organization exist in the commune where it is located?"
lab var Q10_09_02 "(2) Since when does this organization exist in the commune where it is located?"
lab var Q10_09_03 "(3) Since when does this organization exist in the commune where it is located?"
lab var Q10_09_04 "(4) Since when does this organization exist in the commune where it is located?"
lab var Q10_09_05 "(5) Since when does this organization exist in the commune where it is located?"

lab var Q10_10_01 "(1) Since when do you belong to this group?"
lab var Q10_10_02 "(2) Since when do you belong to this group?"
lab var Q10_10_03 "(3) Since when do you belong to this group?"
lab var Q10_10_04 "(4) Since when do you belong to this group?"
lab var Q10_10_05 "(5) Since when do you belong to this group?"

lab var Q10_11_01 "(1) How often do you attend the meetings of the organization?"
lab var Q10_11_02 "(2) How often do you attend the meetings of the organization?"
lab var Q10_11_03 "(3) How often do you attend the meetings of the organization?"
lab var Q10_11_04 "(4) How often do you attend the meetings of the organization?"
lab var Q10_11_05 "(5) How often do you attend the meetings of the organization?"

lab var S10_3_0_S10_4_C13 "AUX"
lab var S10_3_1_S10_7_C2 "AUX"
lab var S10_3_0_S10_7_C6 "AUX"
lab var S10_3_0_S10_11_C9 "AUX"
lab var S10_3_1_S10_11_C9 "AUX"

#delimit
lab def Q10_04
1 "Association of farmers/fishermen"
2 "Association of merchants/traders"
3 "Professional association (eg doctors, teachers)"
4 "Chamber of Commerce"
5 "CACS communal/municipal"
6 "Religious group"
7 "Political movement"
8 "Cultural association"
9 "Sports Group."
10 "NGOs"
11 "Credit group (kixikila)"
12 "Group based on an ethnic community"
13 "Association based on a group of friends"
14 "Association based on a group of residents"
;
#delimit cr
lab val Q10_04_01 Q10_04_02 Q10_04_03 Q10_04

replace Q10_04_01 = . if Q10_04_01==13

replace Q10_04_01 = 1 if S10_3_0_S10_4_C13=="Camponeses (produção de café)"
replace Q10_04_01 = 6 if S10_3_0_S10_4_C13=="Igreja"
replace Q10_04_01 = 1 if S10_3_0_S10_4_C13=="associacao de criadores"

foreach var in Q10_06_01 Q10_06_02 Q10_06_03 Q10_06_04 Q10_06_05{
recode `var' (2=0)
lab val `var' dummy
}

#delimit
lab def Q10_07
1 "In this commune"
2 "In a nearby commune (specify)"
3 "In the capital of the municipality"
4 "Sumbe"
5 "Luanda"
6 "Other (specify)"
;
#delimit cr

rename S10_3_0_S10_7_C6 Q10_07_01_other
rename S10_3_1_S10_7_C2 Q10_07_02_commune

lab var Q10_07_01_other "(1) Name of other"
lab var Q10_07_02_commune "(2) Name of nearby commune"

lab val Q10_07_01 Q10_07_02 Q10_07_03 Q10_07_04 Q10_07_05 Q10_07

order Q10_07_01_other, after(Q10_07_01)
order Q10_07_02_commune, after(Q10_07_02)

foreach var in Q10_08_01 Q10_08_02 Q10_08_03 Q10_08_04 Q10_08_05{
recode `var' (2=0) (3=.)
lab val `var' dummy
}

*dates for Q10_09 and Q10_10

#delimit
lab def Q10_11
1 "Every day"
2 "More than once a week, but not every day"
3 "Once a week"
4 "Once a month"
5 "Once every two months"
6 "Once every three months"
7 "Once every six months"
8 "Once a year"
9 "Never"
;
#delimit cr

foreach var in Q10_11_01 Q10_11_02 Q10_11_03 Q10_11_04 Q10_11_05{
replace `var'=. if `var'==7
recode `var' (2=3) (3=4) (4=6) (5=7) (6=8)
lab val `var' Q10_11
}

replace Q10_11_01 = 4 if S10_3_0_S10_11_C9=="15 em 15 dias"
replace Q10_11_01 = 2 if S10_3_0_S10_11_C9=="2 VEZES POR SEMANA"
replace Q10_11_01 = 2 if S10_3_0_S10_11_C9=="2 vezes por semana"
replace Q10_11_01 = 2 if S10_3_0_S10_11_C9=="2X POR SEMANA"
replace Q10_11_01 = 2 if S10_3_0_S10_11_C9=="3 VEZ POR SEMANA"
replace Q10_11_01 = 2 if S10_3_0_S10_11_C9=="3X POR SEMANA"
replace Q10_11_01 = 9 if S10_3_0_S10_11_C9=="NUNCA"
replace Q10_11_01 = 4 if S10_3_0_S10_11_C9=="duas vezes por mes"
replace Q10_11_01 = 2 if S10_3_0_S10_11_C9=="duas vezes por semana"
replace Q10_11_01 = 2 if S10_3_0_S10_11_C9=="duas vezes por semana."
replace Q10_11_01 = 3 if S10_3_0_S10_11_C9=="fim de semana"
replace Q10_11_01 = 2 if S10_3_0_S10_11_C9=="três dias"

order S10_3_0_S10_4_C13 S10_3_0_S10_11_C9 S10_3_1_S10_11_C9, after(Q10_11_05)
}
********************************************************************************
********************************** SECTION 11 **********************************
********************************************************************************
{
lab var S11_1_C1_Q1 		"Most people in this village/neighborhood are available to help if needed"
lab var S11_1_C2_Q1 		"In this village/neighborhood there are people who want to take advantage of others"
lab var S11_3 				"If you do not have a direct benefit from a community project, would you contribute time or money to this project?"
lab var S11_4 				"In the past year, did you or someone of your household attend a community activity where people came together to work for the community?"
lab var S11_5 				"If, for example, there is a water supply problem in your community, how likely are people to cooperate to solve the problem?"
lab var S11_6 				"In the last year, how often have people in this village/neighborhood come together to ask government officials or political leaders for some improvement in the community?"
lab var S11_7 				"How often do any of these differences divide your village / neighborhood? For example: differences in wealth, income, social status, ethnicity or ethno-linguistic past"
lab var S11_81 				"(1) What are the two differences that cause most often problems?"
lab var S11_82 				"(2) What are the two differences that cause most often problems?"
lab var S11_9 				"Voted in the 2012 general election"
lab var S11_10 				"Do you want to vote in the next elections?"
lab var S11_111 			"(1) What are your three main sources of information about what the government is doing (such as health care reform, education, energy supply, etc.)?"
lab var S11_112 			"(2) What are your three main sources of information about what the government is doing (such as health care reform, education, energy supply, etc.)?"
lab var S11_113 			"(3) What are your three main sources of information about what the government is doing (such as health care reform, education, energy supply, etc.)?"

rename S11_1_C(#)_Q1 Q11_0(#)
rename S11_(#) Q11_0(#)
rename S11_81 Q11_08_01
rename S11_82 Q11_08_02
rename S11_10 Q11_10
rename S11_111 Q11_11_01
rename S11_112 Q11_11_02
rename S11_113 Q11_11_03

#delimit
lab def Q11_03
1 "Would only contribute time"
2 "Would only contribute money"
3 "Would contribute time and money"
4 "Neither would contribute time nor money"
;
lab def Q11_05
1 "Very likely"
2 "Likely"
3 "Neither likely nor unlikely"
4 "Unlikely"
5 "Very unlikely"
;
lab def Q11_06
1 "Never"
2 "Once"
3 "Sometimes (less than or equal to 5)"
4 "Often (more than 5)"
;
lab def Q11_07
1 "Very frequent"
2 "Frequent"
3 "Uncommon"
4 "Never"
;
lab def Q11_08
1 "Education"
2 "Land ownership"
3 "Wealth"
4 "Gender"
5 "Differences between new and old generations"
6 "Differences between old and new residents"
7 "Political party affiliation"
8 "Religion"
9 "Ethnic or linguistic past"
10 "Other more specific disputes (Specify:)"
;
lab def Q11_11
1 "Family, friends and neighbors"
2 "Local or community newspapers"
3 "Announcements on community placards"
4 "National newspaper"
5 "Radio"
6 "Television"
7 "Groups or associations"
8 "Business partners or co-workers"
9 "Community leaders"
10 "Government representatives"
11 "NGOs"
12 "Internet"
13 "Other"
;
#delimit cr

replace Q11_01 = . if Q11_01==6
replace Q11_02 = . if Q11_02==6
lab val Q11_01 Q11_02 agree

lab val Q11_03 Q11_03

recode Q11_04 (2=0)
lab val Q11_04 dummy
rename S11_4_Num Q11_04_num
lab var Q11_04_num "How many times did you or someone of your household attend a community activity last year"

lab val Q11_05 Q11_05
lab val Q11_06 Q11_06
lab val Q11_07 Q11_07

replace Q11_08_01 = . if inlist(Q11_08_01,10,11,12)
replace Q11_08_02 = . if inlist(Q11_08_02,10,11,12)

replace Q11_08_02 = 10 if S11_8_C10=="a delcuencia na juventude"
replace Q11_08_02 = 10 if S11_8_C10=="A delicuencia"
replace Q11_08_02 = 10 if S11_8_C10=="robo"
replace Q11_08_02 = 10 if S11_8_C10=="robos"
replace Q11_08_02 = 10 if S11_8_C10=="robos e feitiçaria"
replace Q11_08_02 = 10 if S11_8_C10=="ROUBO E FOFOCA"
replace Q11_08_02 = 10 if S11_8_C10=="Ladrões"
replace Q11_08_02 = 10 if S11_8_C10=="deliquencia"
replace Q11_08_02 = 10 if S11_8_C10=="casos deroubo"
replace Q11_08_02 = 10 if S11_8_C10=="furtos"

replace Q11_08_02 = 10 if S11_8_C10=="feiço e envenja"
replace Q11_08_02 = 10 if S11_8_C10=="fofoca"
replace Q11_08_02 = 10 if S11_8_C10=="FOFOCAS"
replace Q11_08_02 = 10 if S11_8_C10=="fofoquissi"
replace Q11_08_02 = 10 if S11_8_C10=="inveja"
replace Q11_08_02 = 10 if S11_8_C10=="a inveja"
replace Q11_08_02 = 10 if S11_8_C10=="KILAPI"
replace Q11_08_02 = 10 if S11_8_C10=="KILAPI E FOFOCA"

replace Q11_08_02 = 10 if S11_8_C10=="A falta de çgue"
replace Q11_08_02 = 10 if S11_8_C10=="A falta de medicamentos nos hospital"
replace Q11_08_02 = 10 if S11_8_C10=="saude"
replace Q11_08_02 = 10 if S11_8_C10=="saúde"
replace Q11_08_02 = 10 if S11_8_C10=="saude precaria"
replace Q11_08_02 = 10 if S11_8_C10=="e saúde."
replace Q11_08_02 = 10 if S11_8_C10=="FALTA DE AGUA"
replace Q11_08_02 = 10 if S11_8_C10=="falta de posto de saude"

replace Q11_08_02 = 10 if S11_8_C10=="bebedeira."
replace Q11_08_02 = 10 if S11_8_C10=="Bebidas e drogas"
replace Q11_08_02 = 10 if S11_8_C10=="uso de drogas"
replace Q11_08_02 = 10 if S11_8_C10=="usu de drogas na parte dos jovens"
replace Q11_08_02 = 10 if S11_8_C10=="o uso de bebidas alcoolicas"

replace Q11_08_02 = 10 if S11_8_C10=="a escola esta aolado da estrada"
replace Q11_08_02 = 10 if S11_8_C10=="A POLUIÇAO SONORA POR PARTE DOS JOVENS"
replace Q11_08_02 = 10 if S11_8_C10=="alguns empresarios prejudicam os mais necessitado."
replace Q11_08_02 = 10 if S11_8_C10=="ANIMAIS SOTOS"
replace Q11_08_02 = 10 if S11_8_C10=="condições basicas"
replace Q11_08_02 = 10 if S11_8_C10=="dificil assesso"
replace Q11_08_02 = 10 if S11_8_C10=="e a corrupção"
replace Q11_08_02 = 10 if S11_8_C10=="e baixo salarios dos sobas"
replace Q11_08_02 = 10 if S11_8_C10=="feitisaria"
replace Q11_08_02 = 10 if S11_8_C10=="LUTA DO PODER"
replace Q11_08_02 = 10 if S11_8_C10=="o paludismo e os acidente"
replace Q11_08_02 = 10 if S11_8_C10=="o respeito"
replace Q11_08_02 = 10 if S11_8_C10=="o resto é resto"
replace Q11_08_02 = 10 if S11_8_C10=="ODIO"
replace Q11_08_02 = 10 if S11_8_C10=="Privação de acessos da população"

lab val Q11_08_01 Q11_08_02 Q11_08

recode Q11_09 (2=0)
recode Q11_10 (2=0)
lab val Q11_09 Q11_10 dummy

lab val Q11_11_01 Q11_11_02 Q11_11_03 Q11_11

replace Q11_11_01 = . if Q11_11_01==13
replace Q11_11_01 = 9 if S11_11_C13=="apartir do soba"

replace Q11_11_02 = . if Q11_11_02==13
replace Q11_11_02 = 12 if S11_11_C13=="redes sociais"
replace Q11_11_02 = 1 if S11_11_C13=="familia"

replace Q11_11_03 = . if Q11_11_03==13
replace Q11_11_03 = 1 if S11_11_C13=="e pelos amingos"

order S11_8_C10 S11_11_C13, after(Q11_11_03)
lab var S11_8_C10 "AUX"
lab var S11_11_C13 "AUX"
}
********************************************************************************
********************************** SECTION 12 **********************************
********************************************************************************
{
lab var S12_1_C1_Q1 "Book : does your household have any?"
lab var S12_1_C2_Q1 "Radio : does your household have any?"
lab var S12_1_C3_Q1 "Television : does your household have any?"
lab var S12_1_C4_Q1 "Computer : does your household have any?"
lab var S12_1_C5_Q1 "Internet : does your household have any?"
lab var S12_1_C6_Q1 "Digital camera : does your household have any?"
lab var S12_1_C7_Q1 "Mobile phone : does your household have any?"
lab var S12_1_C8_Q1 "Bicycle : does your household have any?"
lab var S12_1_C9_Q1 "Motorized : does your household have any?"
lab var S12_1_C10_Q1 "Carro : does your household have any?"
lab var S12_1_C11_Q1 "Oven : does your household have any?"
lab var S12_1_C12_Q1 "Washing machine : does your household have any?"
lab var S12_1_C13_Q1 "Fridge : does your household have any?"
lab var S12_1_C14_Q1 "Stove : does your household have any?"
lab var S12_1_C15_Q1 "Land [in hectares] : does your household have any?"
lab var S12_1_C16_Q1 "House : does your household have any?"
lab var S12_1_C17_Q1 "Farmed animals : does your household have any?"
lab var S12_1_C18_Q1 "Agricultural equipment (tractor) : does your household have any?"

lab var S12_1_C1_Q1_C1 "Book : how many are there in your household?"
lab var S12_1_C2_Q1_C1 "Radio : how many are there in your household?"
lab var S12_1_C3_Q1_C1 "Television : how many are there in your household?"
lab var S12_1_C4_Q1_C1 "Computer : how many are there in your household?"
lab var S12_1_C5_Q1_C1 "Internet : how many are there in your household?"
lab var S12_1_C6_Q1_C1 "Digital camera : how many are there in your household?"
lab var S12_1_C7_Q1_C1 "Mobile phone : how many are there in your household?"
lab var S12_1_C8_Q1_C1 "Bicycle : how many are there in your household?"
lab var S12_1_C9_Q1_C1 "Motorized : how many are there in your household?"
lab var S12_1_C10_Q1_C1 "Carro : how many are there in your household?"
lab var S12_1_C11_Q1_C1 "Oven : how many are there in your household?"
lab var S12_1_C12_Q1_C1 "Washing machine : how many are there in your household?"
lab var S12_1_C13_Q1_C1 "Fridge : how many are there in your household?"
lab var S12_1_C14_Q1_C1 "Stove : how many are there in your household?"
lab var S12_1_C15_Q1_C1 "Land [in hectares] : how many are there in your household?"
lab var S12_1_C16_Q1_C1 "House : how many are there in your household?"
lab var S12_1_C17_Q1_C1 "Farmed animals : how many are there in your household?"
lab var S12_1_C18_Q1_C1 "Agricultural equipment (tractor) : how many are there in your household?"

lab var S12_1_C1_Q2 "Book : total value"
lab var S12_1_C2_Q2 "Radio : total value"
lab var S12_1_C3_Q2 "Television : total value"
lab var S12_1_C4_Q2 "Computer : total value"
lab var S12_1_C5_Q2 "Internet : total value"
lab var S12_1_C6_Q2 "Digital camera : total value"
lab var S12_1_C7_Q2 "Mobile phone : total value : total value"
lab var S12_1_C8_Q2 "Bicycle : total value"
lab var S12_1_C9_Q2 "Motorized : total value"
lab var S12_1_C10_Q2 "Carro : total value"
lab var S12_1_C11_Q2 "Oven : total value"
lab var S12_1_C12_Q2 "Washing machine : total value"
lab var S12_1_C13_Q2 "Fridge : total value"
lab var S12_1_C14_Q2 "Stove : total value"
lab var S12_1_C15_Q2 "Land [in hectares] : total value"
lab var S12_1_C16_Q2 "House : total value"
lab var S12_1_C17_Q2 "Farmed animals : total value"
lab var S12_1_C18_Q2 "Agricultural equipment (tractor) : total value"

replace S12_1_C1_Q1_C1 = "" if S12_1_C1_Q1_C1=="MUITOS"
replace S12_1_C2_Q1_C1 = "1" if S12_1_C2_Q1_C1=="Uma"
replace S12_1_C3_Q1_C1 = "1" if S12_1_C3_Q1_C1=="Uma"
replace S12_1_C7_Q1_C1 = "" if S12_1_C7_Q1_C1=="MUITOS"
replace S12_1_C9_Q1_C1 = "1" if S12_1_C9_Q1_C1=="Uma"
replace S12_1_C15_Q1_C1 = "1.5" if S12_1_C15_Q1_C1=="1,5"
replace S12_1_C16_Q1_C1 = "1" if S12_1_C16_Q1_C1=="Um"
replace S12_1_C16_Q1_C1 = "1" if S12_1_C16_Q1_C1=="Uma"
replace S12_1_C17_Q1_C1 = "12" if S12_1_C17_Q1_C1=="8 cabritos i 4 carneiro"
replace S12_1_C17_Q1_C1 = "" if S12_1_C17_Q1_C1=="CAO"
replace S12_1_C17_Q1_C1 = "1" if S12_1_C17_Q1_C1=="Uma"
replace S12_1_C17_Q1_C1 = "1" if S12_1_C17_Q1_C1=="um"
replace S12_1_C17_Q1_C1 = "" if S12_1_C17_Q1_C1=="porcos"
replace S12_1_C17_Q1_C1 = "" if S12_1_C17_Q1_C1=="porcos, galinha"
replace S12_1_C18_Q1_C1 = "" if S12_1_C18_Q1_C1=="MUITOS"
replace S12_1_C18_Q1_C1 = "" if S12_1_C18_Q1_C1=="enxada"
replace S12_1_C18_Q1_C1 = "" if S12_1_C18_Q1_C1=="enxada,catana"
replace S12_1_C18_Q1_C1 = "" if S12_1_C18_Q1_C1=="enxadas"
replace S12_1_C18_Q1_C1 = "" if S12_1_C18_Q1_C1=="enxadas e catanas"

destring S12_1_C1_Q1_C1 S12_1_C2_Q1_C1 S12_1_C3_Q1_C1 S12_1_C4_Q1_C1 S12_1_C5_Q1_C1 S12_1_C6_Q1_C1 S12_1_C7_Q1_C1 S12_1_C8_Q1_C1 S12_1_C9_Q1_C1 S12_1_C10_Q1_C1 S12_1_C11_Q1_C1 S12_1_C12_Q1_C1 S12_1_C13_Q1_C1 S12_1_C14_Q1_C1 S12_1_C15_Q1_C1 S12_1_C16_Q1_C1 S12_1_C17_Q1_C1 S12_1_C18_Q1_C1, replace

foreach var in S12_1_C1_Q1 S12_1_C2_Q1 S12_1_C3_Q1 S12_1_C4_Q1 S12_1_C5_Q1 S12_1_C6_Q1 S12_1_C7_Q1 S12_1_C8_Q1 S12_1_C9_Q1 S12_1_C10_Q1 S12_1_C11_Q1 S12_1_C12_Q1 S12_1_C13_Q1 S12_1_C14_Q1 S12_1_C15_Q1 S12_1_C16_Q1 S12_1_C17_Q1 S12_1_C18_Q1{
recode `var' (2=0)
lab val `var' dummy
}

rename S12_1_C(#)_Q1 Q12_01_0(#)
rename S12_1_C(##)_Q1 Q12_01_(##)

rename S12_1_C(#)_Q1_C1 Q12_02_0(#)
rename S12_1_C(##)_Q1_C1 Q12_02_(##)

rename S12_1_C(#)_Q2 Q12_03_0(#)
rename S12_1_C(##)_Q2 Q12_03_(##)

forval n=1/9{
replace Q12_01_0`n' = 0 if Q12_02_0`n'==0
replace Q12_02_0`n' = . if Q12_02_0`n'==0
replace Q12_03_0`n' = . if Q12_01_0`n'!=1
replace Q12_03_0`n' = . if Q12_03_0`n'==0
}

forval n=0/8{
replace Q12_01_1`n' = 0 if Q12_02_1`n'==0
replace Q12_02_1`n' = . if Q12_02_1`n'==0
replace Q12_03_1`n' = . if Q12_01_1`n'!=1
replace Q12_03_1`n' = . if Q12_03_1`n'==0
}

** many low values that should probably be multiplied by 1000
}

order school_id resp_idgame

rename P* PP*
rename S* PP*
rename Q* PQ*

rename resp_id 			P_resp_id
rename bairro_name 		P_bairro_name
rename time_start  		P_time_start
rename time_finish  	P_time_finish
rename school_name  	P_school_name
rename resp_name  		P_resp_name
rename resp_tel  		P_resp_tel
rename vil_id  			P_vil_id
rename commune_name  	P_commune_name
rename student_name 	P_student_name
rename student_class 	P_student_class
rename resp_relation	P_resp_relation


save "$Baseline_dtRaw/_intermediate files/baseline_parents.dta", replace
